• 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: Binding the enabled attribute of each NSPopUpButtonCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding the enabled attribute of each NSPopUpButtonCell


  • Subject: Re: Binding the enabled attribute of each NSPopUpButtonCell
  • From: Dave Geering <email@hidden>
  • Date: Wed, 6 May 2009 13:40:54 +1000

On Wed, May 6, 2009 at 12:57 PM, Jerry Krinock <email@hidden> wrote:
>
> Bindings are wonderful.  I try and use bindings whenever available -- except
> when I'm dealing with menus.
>
> You see from Ken's response that there are things that just don't fit, or if
> they do fit, it might take a long time to figure out how.
>
> My advice is to not use bindings to create menus.  You will write less code
> and spend less time if you create your menus on the fly and use
> target/action.

Bugger, I was afraid someone might say that.

Although, after what Ken said I realised I had not put a lot of
thought into my setup. I don't know how I expected it to work. I'm
almost laughing about it now that I think about what I was trying to
do.

It'd be nice if I could somehow hook into whatever is responsible for
making the menu . . .

  - (void) willAddMenuItem:(NSMenuItem *) aMenuItem
  toPopUpButton:(NSPopUpButton *)
  forObject:(id) yourObject
  {
    [aMenuItem setEnabled:[[yourObject valueForKey:@"optionAllowed"]
boolValue]];
  }

...
...
...

Anyway, enough dreaming, I'll resort to code-based menu making and see
if it really is less hassle.

Thanks for your help,
Dave.
_______________________________________________

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:
    • Re: Binding the enabled attribute of each NSPopUpButtonCell
      • From: Jerry Krinock <email@hidden>
References: 
 >Binding the enabled attribute of each NSPopUpButtonCell (From: Dave Geering <email@hidden>)
 >Re: Binding the enabled attribute of each NSPopUpButtonCell (From: Ken Thomases <email@hidden>)
 >Re: Binding the enabled attribute of each NSPopUpButtonCell (From: Jerry Krinock <email@hidden>)

  • Prev by Date: NSNotificationQueue & NSOperationQueue thread death
  • Next by Date: Re: NSNotificationQueue & NSOperationQueue thread death
  • Previous by thread: Re: Binding the enabled attribute of each NSPopUpButtonCell
  • Next by thread: Re: Binding the enabled attribute of each NSPopUpButtonCell
  • Index(es):
    • Date
    • Thread