Re: Help on NSToolbar
Re: Help on NSToolbar
- Subject: Re: Help on NSToolbar
- From: Mike Abdullah <email@hidden>
- Date: Sun, 12 Mar 2006 18:13:03 +0000
On 12 Mar 2006, at 17:52, Uli Kusterer wrote:
Am 12.03.2006 um 18:39 schrieb Karim Morsy:
I'd like to create a preference window for my application in the
style of the regular mac os apps, such as itunes, i.e. a window
with a toolbar that contains various items.
the items are highlighted in grey when selected.
I've created an nstoolbar an added six items along with their images.
I haven't found a method neither in NSToolbar nor in NSToolbarItem
that does the grey highlighting when an item is selected. how can
this be achieved ?
Look at selectedItemIdentifiers or whatever it was called.
Yes, use setSelectedItemIdentifier: of NSToolbar to set which item is
selected
+ for each toolbar item I'm displaying a different view. the best
approach would probably be to have a seperate nibfile for the
prefs window and for each displayed preference item. what would
then be the best way to implement this ? I have an
nswindowcontroller for the prefs window. how would I load the
other windows then (depending on the item selection), such as the
window that's dsiplayed for "Advanced" or "General".
Don't use separate windows. Just show/hide the views in one window.
In your toolbar window's nib file add an NSView for each preference.
When the user selects a item from the toolbar, set the contentView of
the window to nil, resize the window using setFrame: if needed, and
then set its contentView to the new view for the preference.
Look at NSNibLoading on how to actually load a NIB file.
An alternative approach would be to use a tab view. That way, you
can set up all your preferences in one NIB file. An NSTabView can
be set up to have no tabs and no border, in which case it'll be
invisible and you can use the toolbar to control it.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden