Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enable the Copy Menu



On Monday, September 1, 2003, at 07:47 AM, Lorenzo wrote:

Hi,
I can programmatically enable/disable the other menu items but not the
"Copy" Menu. I noted that the "Edit" menu has the flag "Auto Enabled Items"
on.
If I deactivated this check-box I can programmatically enable/disable the
"Copy" menu, but this way I loose the nice "auto enabling" feature on the
text selections.


Do you know how to let my object enable/disable the "Copy" menu without
loosing the "auto enabling" feature?
Thank you.




Using autoenabling, Cocoa searches the responder chain for objects that respond to the action associated with the menu item. If you look at the Copy menu item, its action message is copy:, so add that action to your object and it should be enabled. You can also create a validateMenuItem: method in your object, where you can then enable/disable that menu item based on the context of your object, like if nothing is selected, you can disable the Copy menu item. Using validateMenuItem: allows you to override autoenabling.

Don
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Enable the Copy Menu (From: Lorenzo <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.