Re: One more NSToolbar question
Re: One more NSToolbar question
- Subject: Re: One more NSToolbar question
- From: Matthew Formica <email@hidden>
- Date: Wed, 09 May 2001 09:36:09 -0700
See
http://developer.apple.com/qa/qa2001/qa1029.html and
http://developer.apple.com/qa/qa2001/qa1030.html for more NSToolbar Info...
Matthew
on 5/8/01 6:19 PM, Matt Ridley at email@hidden remarked:
>
Hi folks,
>
>
I've been reading the AppKit release notes; specifically the
>
section on NSToolbar; and I saw the following text:
>
>
> A couple of methods have been added to NSWindow to help support
>
> NSToolbar. NSWindow now lets you add a toolbar, show/hide the
>
> current toolbar, and run the customization palette. If you add
>
> menu items in your application and hook them up to
>
> toggleToolbarShown:, and runToolbarCustomizationPalette:
>
> NSWindow will take care of validation. In particular, the menu
>
> item with toggleToolbarShown: as its action will properly title
>
> the menu item dependent on the current state of the toolbar.
>
>
This is all true enough (I see it in NSWindow.h), but those
>
actions aren't listed in Interface Builder when I control-drag
>
from my "Hide/Show Toolbar" menu item to my window. Thus, I'm
>
unclear as to how to specify toggleToolbarShown: as the action
>
for my menu item.
>
>
Currently, I have a ToolbarController class which takes care of
>
all processing related to my NSToolbar. It has two custom
>
actions, one of which is showHideToolbar:. In my implementation
>
for showHideToolbar:, I simply do this:
>
>
[toolbarWindow toggleToolbarShown:sender];
>
>
This has the desired effect of hiding/showing the toolbar in the
>
endorsed way (highlighting the toolbar widget at the right of
>
the titlebar as it does so), but it does NOT automatically
>
change the title of my "Hide/Show Toolbar" menu item. I'm
>
presuming that if I could somehow directly specify
>
toggleToolbarShown: as the action for my menu item (in Interface
>
Builder), that it would then take charge of the title of my menu
>
item, and make it either "Hide Toolbar" or "Show Toolbar" as
>
appropriate. But, as I said, Interface Builder doesn't seem to
>
know about that action.
>
>
Any help would be much appreciated. It's a minor cosmetic
>
problem, but I'd like my menu item not to always just say
>
"Hide/Show Toolbar" - that's quite clumsy. Thanks once
>
again. :-)
>
>
>
Best,
>
-Matt
>
>
--
>
Matt Ridley
>
<http://www.mattridley.com/>
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev