• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Enable the Copy Menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

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

  • Prev by Date: colorspace for grayscale images
  • Next by Date: Re: Open windows in frontmost...
  • Previous by thread: Re: colorspace for grayscale images
  • Next by thread: Re: Open windows in frontmost...
  • Index(es):
    • Date
    • Thread