Skip navigation.
 
mlHow to limit clickable area in custom NSOutlineView cell?
FROM : Dave Camp
DATE : Fri May 04 16:01:01 2007

I've got an NSOutlineView and I've made a subclass of NSCell to use 
in one of the columns. The cell works as expected except for click 
handling. The desired behavior is that if the user clicks in a 
specific rectangle in the cell, I want the value to change (e.g. a 
checkbox). If the user clicks anywhere else in the cell, I just want 
the row to highlight.

The problem is that NSOutlineView calls my setObejctValue with a new 
value no matter where I click in the cell. I've tried overriding both 
the trackMouse:inRect:ofView:untilMouseUp: and startTrackingAt/
continueTracking/stopTracking methods to no avail. No matter what I 
return I still get called to change my value no matter where the 
click was.

What am I missing? I've reviewed the NSCell and NSTableView docs and 
I don't see anything that would help me limit the target area other 
than the mouse tracking methods. Is there a better way to handle this?

Thanks,
Dave

Related mailsAuthorDate
No related mails found.