Re: Enable the Copy Menu
Re: Enable the Copy Menu
- Subject: Re: Enable the Copy Menu
- From: Don Arbow <email@hidden>
- Date: Mon, 1 Sep 2003 10:10:47 -0700
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.