Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connecting NSToolbar and NSTabView



On Aug 29, 2008, at 15:08, David Reitter wrote:

Sorry, where in IB do I set the identifier of the NSToolbarItem? Is it just the Label? At least this is what can be bound.

Doh, I forgot that IB 3.1 fails to expose the toolbar item identifiers. Perhaps a future version of IB might do this.


The workaround is to create outlets in your window controller that are connected to the toolbar items. Then, in your window controller awakeFromNib, use the outlets to get each toolbar item identifier and set it as the tab item identifier of the correponding tab view item. That makes them match.

Do I just call the toolbar 'prefstoolbar' in "Interface Builder Identity", in order to access it?
I don't quite understand how I can address the NSToolbar instance from the NSTabview.


Also, doesn't a delegate to the NSToolbar have to provide toolbarSelectableItemIdentifiers to make them permanently selectable?

Assuming that your window controller is File's Owner of the window nib, you can get to the toolbar's selected item identifier as File's Owner.window.toolbar.selectedItemIdentifier.


Or, as a no-bindings approach, you could probably forget about identifiers and set the toolbar item tags to the corresponding tab view item indexes in IB, then give all of the toolbar items a shared action that retrieves the tag, and uses it to set the appropriate tab view item index.
_______________________________________________


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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Connecting NSToolbar and NSTabView (From: David Reitter <email@hidden>)
 >Re: Connecting NSToolbar and NSTabView (From: Quincey Morris <email@hidden>)
 >Re: Connecting NSToolbar and NSTabView (From: Quincey Morris <email@hidden>)
 >Re: Connecting NSToolbar and NSTabView (From: David Reitter <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.