Re: click in NSButtonCell in NSTableView without selecting table row?
Re: click in NSButtonCell in NSTableView without selecting table row?
- Subject: Re: click in NSButtonCell in NSTableView without selecting table row?
- From: Corbin Dunn <email@hidden>
- Date: Mon, 27 Apr 2009 18:17:23 -0700
On Apr 27, 2009, at 1:43 PM, Dan Rowley wrote:
Hello - I've done multiple searches and seen this topic discussed,
but none with a solution that doesn't feel like a hack. I have an
NSTableView, and one column that contains an NSButtonCell. I would
like the user to be able to interact with this cell without the
selection in the table changing. In the documentation for -
tableView:shouldTrackCell:forTableColumn:row: , it says "For
example, this allows you to have an NSButtonCell in a table which
does not change the selection, but can still be clicked on and
tracked," yet I'm not exactly sure how to actually achieve this end.
I return YES from the delegate method, then indeed my button works
correctly (the data source gets the expected setObjectValue
message), but the selection of the table also changes. The obvious
first solution is to override tableView:shouldSelectRow:, yet this
gets sent BEFORE shouldTrackCell, so I'm not really sure where to go
from here. Do I have to gawk at the current mouse event in
shouldSelectRow: and return NO if it appears that the mouse went
down in the button cell? This feels harder than it ought to be.
Am I missing something painfully obvious?
the DragNDropOutlineView example does this on Leopard. If after
checking it out you still have questions, then please repost.
corbin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden