开发者

Highlight NSView on Rollover/Click

开发者 https://www.devze.com 2023-03-17 06:41 出处:网络
Upon rolling over or clicking on an NSView, how can I update the view so that I can change the colour and other properties of view? It\'s the redra开发者_如何学JAVAwing of the view which is the key to

Upon rolling over or clicking on an NSView, how can I update the view so that I can change the colour and other properties of view? It's the redra开发者_如何学JAVAwing of the view which is the key to what I need to do, I already have a subclass created.


Listen for mouse events and do appropriate actions inside them.

-(void)mouseEntered:(NSEvent *)theEvent {
    //draw rollover
}

-(void)mouseExited:(NSEvent *)theEvent {
    //draw normal
}

-(void)mouseDown:(NSEvent *)theEvent {
    //draw selected
}

-(void)mouseUp:(NSEvent *)theEvent {
    //draw normal
}
0

精彩评论

暂无评论...
验证码 换一张
取 消