Re: NSPopupButton, bindings, and item state
Re: NSPopupButton, bindings, and item state
- Subject: Re: NSPopupButton, bindings, and item state
- From: Keary Suska <email@hidden>
- Date: Fri, 15 Aug 2014 08:18:45 -0600
On Aug 15, 2014, at 5:23 AM, Jonathan Taylor <email@hidden> wrote:
> After being impressed with bindings for an NSTableView, I’m looking at what I can do for a standalone NSPopupButton, in the hope of reducing the amount of glue code I have. The button isn’t just a simple one though, I need to:
> - Include separator items
> - Disable (grey out) some items
> - Select multiple items (it’s configured as a pull-down menu)
>
> It’s not obvious to me that there’s a way of doing any of those things with bindings (though the multiple-selected-items might work somehow through the array controller). Can anyone advise on whether there is any hope for this approach, or do I have to accept that this is more than the bindings are intended to help with?
Short answer, yes. With some hackery you could get separator items, but the multiple checked state will likely require as much work as your glue code. So I wold say the best approaches are a 50/50 between bindings and glue. That is, you could use bindings for content, but manually handle state, or use bindings for state, and manually handle content. Doing both is probably an exercise in futility.
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