On Jan 15, 2009, at 4:04 AM, Kubernan wrote:

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 ?

Have you tried setting the filterPredicate at the point the "row" object is set/selected? I assume that would happen before the popup is opened. And probably a saner approach.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to