objective c - Mouse events for an NSSegmentedCell subclass? -
I am trying to apply some basic tabs to the coco editor on which I am working. I am using an NSSegmentedControl and adding it as a tab. I'm using a custom NSSegmentedCell subclass for tabs to pull a little 'X' icon next to the text to close the tabs and now Till it is getting very greasy.
However, I can not understand how to actually check the process of mouse events for tabs, whether someone has been placed on the 'x' icon (or clicked on) I tried to override the "mouse mood" in the NSSegmentedControl subclass, but for some strange reasons when I add a new segment to it (I set "setAcceptptsMouseMovedEvents" in awakeFromNib, do I have to set it somewhere else Is it?). NSSegmentedCells, there are no mouse tracking processing when the NSCell subclasses are done, on one hand, mouse tracking, which only starts when the control is clicked.
So the question is, how do I process mouse events properly, either in NSSegmentedControl or in the NSSegmentedCell subclass?
Take a look You can add a tracking area to your NSSegmentedControl
and Close events by clicking the mouse button.
In order to achieve click events, you might want to experiment with a different NSActionCell
subclass and test a few hits there for the best close button.
Comments
Post a Comment