I'm working on a custom button component. I've been reading through the documentation for NSControl and NSCell, and the programming topics associated with it.
What I can't figure out is how to correctly use mouse events in NSCell's. I see that NSControl subclasses NSView, which implements NSResponder - so implementing mouse events in the control and forwarding to the cell is simple. But the documentation states that when a control needs to be placed in a Table, the Cell for the control is used, not the control.
The methods that are available in the cell are somewhat well documented, but confusing to understand how to implement. Ultimately what I'm trying to figure out is how to replicate a push button; a down image is shown while the mouse is down, until the mouse is up. I've already got the images and text etc working fine.
I've been experimenting and messing around with different combinations of the mouse methods for NSCell, but just can't get it right.
-Is using NSCell for mouse events in this respect even correct?
-Is using the mouse events from NSControl and forwarding to the cell the right way?
-If I use mouse events from the Control and forward to the cell, how does a Table know that I need certain mouse events forwarded to my cell?
-If the mouse events are needed from an NSControl, can a table use an NSControl?
Any takers?