Re: Menu for multiple document types
Re: Menu for multiple document types
- Subject: Re: Menu for multiple document types
- From: "Sherm Pendley" <email@hidden>
- Date: Wed, 10 Sep 2008 18:19:17 -0400
On Wed, Sep 10, 2008 at 5:56 PM, David <email@hidden> wrote:
> What is the convention of the application menu when an application
> supports multiple document types?
>
> Should the menu change to show the actions available to the type of
> document currently open?
No, changing menus are not recommended in Apple's Human Interface
Guidelines.
> Can the menu show the superset of actions available to each document
> type, then disable the actions (but still make them visible) which are
> inappropriate for the currently open document?
Right, that's what the HIG recommends, and the default behavior is
supportive of this approach.
> I don't see any built in support in the document architecture for
> changing the menu based on the currently open document type.
It's built-in. When a menu item's target is connected to the "first
responder" icon in IB, the menu's action message is sent along the responder
chain. If nothing in the responder chain implements the corresponding action
message, the menu item is automagically disabled. So all you need to do here
is define an NSDocument subclass for each of your document types. In each
one, you'd only implement the action methods appropriate for that document
type.
For details, have a look at:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_6.html
>
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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