Filtering NSPopUpButtonCell when clicking on it
Filtering NSPopUpButtonCell when clicking on it
- Subject: Filtering NSPopUpButtonCell when clicking on it
- From: Kubernan <email@hidden>
- Date: Thu, 15 Jan 2009 12:04:14 +0100
Hello,
In my outline view i have a NSPopUpButtonCell for which the table
column is bound
to a NSArrayController that contains coredata entities.
The goal is to restrict the content of items in the pop up cell
depending on
other attributes of the row.
So i decided to call the setFilterPredicate: of the array controller
as soon as the user
click on the pop up cell and of course before the content of this pop
up is displayed.
For that it seems i could use (BOOL)trackMouse:(NSEvent *)theEvent
inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:
(BOOL)untilMouseUp in a subclass of NSPopUpButtonCell. But this method
appears to me
little bit complex for my simple need and the documentation says "This
method is generally not overridden because the default implementation
invokes other NSCell methods that can be overridden to handle specific
events in a dragging session."
My question is what methods and strategy should i use for setting the
predicate of my array controller before
the content of the pop up cell is displayed ?
Thanks a lot for your help,
Kub.
_______________________________________________
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