Handle mouse events correctly with NSControl and NSCell?

I am working on a custom button component. I've read the documentation for NSControl and NSCell, and related programming topics.

I cannot figure out how to use mouse events correctly in NSCell. I can see that there are subclasses of NSControl NSView that implement NSResponder - so implementing mouse events in control and forwarding to a cell is easy. But the documentation states that when a control is to be placed in a table, the cell for the control is used, not the control.

The methods available in the cell are well documented but confusing to understand how to implement them. Ultimately I'm trying to figure out how to copy a button; the image down is displayed until the mouse works until the mouse stands up. I already have images and text, etc. Works great.

I have been experimenting and tinkering with different combinations of mouse methods for NSCell but just can't figure it out.

-I'm using NSCell for mouse events in this regard even correct?

- Am I using mouse events from NSControl and forwarding to the cell in the correct way?

-If I use mouse events from the control and forward to a cell, how does the table know that I need certain mouse events to be routed to my cell?

- If mouse events are needed from NSControl, can the table use NSControl?

Any members?

+2


source to share





All Articles