• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Filtering NSPopUpButtonCell when clicking on it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filtering NSPopUpButtonCell when clicking on it


  • Subject: Re: Filtering NSPopUpButtonCell when clicking on it
  • From: Keary Suska <email@hidden>
  • Date: Thu, 15 Jan 2009 09:25:29 -0700


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 (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


  • Follow-Ups:
    • Fwd: Filtering NSPopUpButtonCell when clicking on it
      • From: Kubernan <email@hidden>
References: 
 >Filtering NSPopUpButtonCell when clicking on it (From: Kubernan <email@hidden>)

  • Prev by Date: Re: completely messed up with bindings...
  • Next by Date: Re: NIB's owner doesn't get released because of NSArrayController
  • Previous by thread: Filtering NSPopUpButtonCell when clicking on it
  • Next by thread: Fwd: Filtering NSPopUpButtonCell when clicking on it
  • Index(es):
    • Date
    • Thread