Re: Connecting NSToolbar and NSTabView
Re: Connecting NSToolbar and NSTabView
- Subject: Re: Connecting NSToolbar and NSTabView
- From: Quincey Morris <email@hidden>
- Date: Fri, 29 Aug 2008 16:00:43 -0700
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:
This email sent to email@hidden