Re: hierarchical menus (SOLVED)
Re: hierarchical menus (SOLVED)
- Subject: Re: hierarchical menus (SOLVED)
- From: Matt Neuburg <email@hidden>
- Date: Tue, 14 Mar 2006 11:39:33 -0800
- Thread-topic: hierarchical menus (SOLVED)
On or about 3/14/06 11:07 AM, thus spake "Boyd Collier"
<email@hidden>:
> Matt,
>
> Thanks very much! Your suggestion was a great help and saved me many
> hours.
>
> Re Apple's documentation: curiously, validateMenuItem isn't
> mentioned, AFAIK, in the documentation of either NSMenuItem or
> NSMenu. Rather, it's in NSDocument and not adequately explained there.
Mmmmm, no. It isn't in NSMenuItem or NSMenu because it isn't an NSMenuItem
or NSMenu method. It's an NSMenuValidation informal protocol method.
However, that's neither here nor there; the place to learn about how menus
work is the documentation on how menus work:
<http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/index.ht
ml>
However, what isn't really documented very well is that you might cheat and
use validateMenuItems for some purpose other than menu validation. Just to
give an example, it's quite common to misuse validateMenuItems to decide on
the fly whether to place a checkmark in a menu item. From there to misusing
it to build a hierarchical menu on the fly is just a short tumble down a
very slippery slope.
Still, as I said in my previous note, I don't really recommend that you do
this; try to rebuild the menu each time the thing it depends upon changes,
if you can. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden