RS: menu items
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