Simple mouseover effect on NSButton

后端 未结 7 700
Happy的楠姐
Happy的楠姐 2021-02-04 01:51

I am creating a custom NSButtonCell for a custom rendering.

Now, I want to have different aspect depending if the mouse is over the button or not. How can

7条回答
  •  心在旅途
    2021-02-04 02:14

    a good starting point, declared in NSResponder:

    - (void)mouseEntered:(NSEvent *)theEvent;
    - (void)mouseExited:(NSEvent *)theEvent;
    

    specifically, the button cell's container (not the cell itself) is the NSResponder.

提交回复
热议问题