Re: User interface validation doesn't work, right?
Re: User interface validation doesn't work, right?
- Subject: Re: User interface validation doesn't work, right?
- From: Quincey Morris <email@hidden>
- Date: Thu, 2 Jul 2009 17:38:54 -0700
Er, sorry about all the typos in the previous post on this subject.
On Jul 2, 2009, at 16:33, Quincey Morris wrote:
Something (presumabl[y] NSApp) presumabl[y] calls 'update' for the
main NSMenu, and the 'update' calls trickle down to the NSMenuItems,
which then initiate their own validation.
A similar thing presumably happens starting from a window[']s
NSToolbar. The example laid out in this document pretty much
explains how it's implemented, and it suggests you could add similar
functionality to other classes by adding 'update' to them via a
category.
On further reflection, neither of these statements can be exactly true.
We know that not every menu is validated all the time, so either the
initiator of the validation process (NSApp? we don't know) filters out
menus and menu items that don't currently need validating, or 'update'
figures it out on a case-by-case basis.
Neither NSToolbar nor NSToolbarItem has an 'update' method, but they
have 'validateVisibleItems' and 'validate' respectively, which seem to
perform much the same role. It's curious that the strategy that the
documentation explains (as an example) for automatic toolbar item
validation *isn't* what toolbars actually use.
It remains totally mysterious what's going to cause individual
validatable interface items to trigger their own validation. Perhaps
there's no automatic general mechanism at all, and each interface item
class has to solve the problem for itself. Or, the documentation could
be construed to imply, any object in the responder chain that
implements 'update' will be have its 'update' called automatically
(when?), but that's more speculation than anything else.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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