FROM : Louis C. Sacha
DATE : Wed Oct 06 22:06:39 2004
Hello...
You could create an action method in your NSDocument subclass that
toggles the drawer's opened/closed state, for example
- (void)toggleDrawerState:(id)sender
{
/* ... */
}
Then in your MainMenu.nib, you would add a new action method
toggleDrawerState: to the "First Responder" proxy , and then connect
your menu item to "First Responder" and its new "toggleDrawerState:"
action. You can add actions to the "First Responder" proxy the same
way you would add them to a class you are creating in
InterfaceBuilder.
<file:///Developer/Applications/Interface%20Builder.app/Contents/Resources/English.lproj/InterfaceBuilder_Help/CocoaClass/chapter_5_section_3.html#//apple_ref/doc/uid/20001745/BBCBJCDH>
Hope that helps,
Louis
>Is it possible to have a command from the menu to toggle the
>currently focused document? I am created a multi-document
>application which has a drawer. I have managed to add a button
>which can toggle the drawer. However, with the two different nibs
>(MyDocument and MainMenu), it seems that the MainMenu cannot
>directly communicate with the NSDrawer in the MyDocument nib. Is
>there a way to get around this so I can have a command in the menu
>to toggle the drawer? This is my preferred way of doing things
>since the button in the main window interface is purely temporary.
>
>Chad Armstrong
>
DATE : Wed Oct 06 22:06:39 2004
Hello...
You could create an action method in your NSDocument subclass that
toggles the drawer's opened/closed state, for example
- (void)toggleDrawerState:(id)sender
{
/* ... */
}
Then in your MainMenu.nib, you would add a new action method
toggleDrawerState: to the "First Responder" proxy , and then connect
your menu item to "First Responder" and its new "toggleDrawerState:"
action. You can add actions to the "First Responder" proxy the same
way you would add them to a class you are creating in
InterfaceBuilder.
<file:///Developer/Applications/Interface%20Builder.app/Contents/Resources/English.lproj/InterfaceBuilder_Help/CocoaClass/chapter_5_section_3.html#//apple_ref/doc/uid/20001745/BBCBJCDH>
Hope that helps,
Louis
>Is it possible to have a command from the menu to toggle the
>currently focused document? I am created a multi-document
>application which has a drawer. I have managed to add a button
>which can toggle the drawer. However, with the two different nibs
>(MyDocument and MainMenu), it seems that the MainMenu cannot
>directly communicate with the NSDrawer in the MyDocument nib. Is
>there a way to get around this so I can have a command in the menu
>to toggle the drawer? This is my preferred way of doing things
>since the button in the main window interface is purely temporary.
>
>Chad Armstrong
>
| Related mails | Author | Date |
|---|---|---|
| Chad Armstrong | Aug 20, 19:09 | |
| Louis C. Sacha | Oct 6, 22:06 |






Cocoa mail archive

