NSTableView, PopUpButtons, and controlling selection
NSTableView, PopUpButtons, and controlling selection
- Subject: NSTableView, PopUpButtons, and controlling selection
- From: Aaron Burghardt <email@hidden>
- Date: Wed, 18 Jun 2003 11:12:51 -0400
Hi All,
I am using an NSTableView in which one column has a PopUpButton cell. I
have the popup displaying and functioning correctly. However, I don't
want the selection in the table to change when the user clicks on the
popup, but I haven't figured out how to achieve this behavior (the
check boxes next to the song names in iTunes exhibit the behavior I'm
looking for).
I experimented with
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView
but if I return NO, then the mouse click event doesn't reach the popup.
I also looked at subclassing NSPopUpButtonCell and tracking the mouse
in the cell, but that's too late, the selection has already changed. I
could use tracking in the cell and require a ctrl-click to activate the
popup, but I shouldn't have to resort to that.
The only other possibility I can think of is to subclass NSTableView
and override the mousedown event, but I suspect I will have to do a lot
of work to determine whether the event happened over popup cell.
Any hints, anyone?
Thanks,
----
Aaron Burghardt
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.