On 2/8/14 12:25 AM, Quincey Morris wrote:
It’s a while since I had to suffer through the pain that is NSToolbar delegate
methods, but I suspect the problem is that the IB-created items are in a
different universe from programmatically created ones. Therefore, in a “mixed”
configuration, ‘toolbarAllowedItemIdentifiers:’ is queried only to supply the
identifiers of non-IB items that you want to add to the IB-defined toolbar. The
delegate method is, after all, optional *in this case*.

If that’s correct, and you have a toolbar whose items are allowed in a
*contextually* dependent way, you’ll have to create the toolbar contents
programmatically — or at least those items.

Note that I’m speculating. I vaguely recall that there was something very
horrible about mixing IB and non-IB items, and this may or may not be it.

Yes, horrible comes to mind.

I ended up duplicating the entire toolbar so it's constructed at runtime - with embedded segmented controls that's a lot of fun. That was only way to make it work.

Unfortunately I can't even use the same toolbar identifier (for auto-configuration saving purposes), because even though -toolbarAllowedItemIdentifiers: returns a reduced set, NSToolbar will reconstruct items with identifiers not currently allowed when restoring a toolbar configuration that was stored when all items were allowed.

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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

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

Reply via email to