• 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: Enabling NSMenuItem in Code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling NSMenuItem in Code?


  • Subject: Re: Enabling NSMenuItem in Code?
  • From: Jeffrey J Barbose <email@hidden>
  • Date: Tue, 20 Apr 2004 19:02:54 -0700

the target should implement validateMenuItem: as well. its return value sets enabled or not.





On 2004, Apr 20, at 17.38, David Piasecki wrote:

I added an NSMenuItem to one of my NSMenu's using Objective-C, but I
can't figure out how to enable the menu item. Right now it's grey. I
can't figure out how to make it black and hence selectable by the user.

The code I used to add the menu item.
[IconsMenu addItemWithTitle:@"New Menu Item"
action:@selector(MenuItemSelected:) keyEquivalent:@""];

I also tried forcing it to be enabled, but since it didn't work, I
guess "enabled" is the wrong term.
[[IconsMenu itemWithTitle:@"New Menu Item"] setEnabled:true];

David
_______________________________________________
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.
_______________________________________________
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.


  • Follow-Ups:
    • Re: Enabling NSMenuItem in Code?
      • From: Sherm Pendley <email@hidden>
References: 
 >Enabling NSMenuItem in Code? (From: "David Piasecki" <email@hidden>)

  • Prev by Date: Re: Enabling NSMenuItem in Code?
  • Next by Date: Re: Locking from within an enumerator
  • Previous by thread: Re: Enabling NSMenuItem in Code?
  • Next by thread: Re: Enabling NSMenuItem in Code?
  • Index(es):
    • Date
    • Thread