• 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
RS: menu items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RS: menu items


  • Subject: RS: menu items
  • From: Roland Silver <email@hidden>
  • Date: Mon, 11 Jun 2007 15:55:08 -0600

I don't seem to understand enabling/disabling menu items.
I assume that (1) if one is enabled, it appears black and you can click on it, invoking its associated IBAction. (2) If it's disabled, it appears gray and clicking on it does nothing, and that (3) the NSMenuItem method setEnabled: enables/disables the receiver in the above sense.


I created a project, MenuItemTest, which has two menu items under the menu "Test": Test1 and Test2.
Clicking on Test1 logs a message like:
2007-06-11 14:19:09.913 MenuItemTest[1613] test1Action invoked. sender=<MenuItem: 0x3227c0 Item1>


Clicking on Test2 logs:
2007-06-11 14:19:18.474 MenuItemTest[1613] test2Action
test1Outlet before. [test1Outlet isEnabled]=1
2007-06-11 14:19:18.475 MenuItemTest[1613] test1Outlet after. [test1Outlet isEnabled]=0


Between the two log messages it disables Test1 by: [test1Outlet setEnabled:NO].

I intended test2Action to disable Test1, logging its state before and after doing so.
It seems to indicate that now Test1 IS disabled -- however Test1 still appears black, and clicking on it logs:
2007-06-11 14:19:43.146 MenuItemTest[1613] test1Action invoked. sender=<MenuItem: 0x3227c0 Item1>


What am I missing?

If anyone wants the project (85 KB), let me know and I'll email it to him.

--Roland Silver <email@hidden>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: RS: menu items
      • From: mmalc Crawford <email@hidden>
  • Prev by Date: Issues Binding to Child of On The Fly Vended Key
  • Next by Date: Re: RS: menu items
  • Previous by thread: Issues Binding to Child of On The Fly Vended Key
  • Next by thread: Re: RS: menu items
  • Index(es):
    • Date
    • Thread