Re: validateMenuItem: issues
Re: validateMenuItem: issues
- Subject: Re: validateMenuItem: issues
- From: John Nairn <email@hidden>
- Date: Thu, 23 May 2002 08:43:30 -0600
I had the exact same problem and fixed it be rebuilding the entire File
menu in Interface builder. I dragged a new "File" menu from the menus
palette between the old File and Edit menu, reconnected all menu
commands in the new File menu, added my own commands, and finally
deleted the old File menu. After this change, all menu items in the File
menu worked correctly. I even noticed is was not just my own commands
that failed before, but no commands in the original File menu enabled
and disabled correctly. For example, in a multidocument application, the
save options and print commands would be enabled even when no document
was in front. Now they correctly disable in this situation.
Maybe the File menu always has to be deleted and rebuilt when starting a
multidocument application in Project Builder/Interface Builder? I will
see what happens the next time I start a new application. Others might
check their multidocument applications and see if the Save command is
automatically disabling when no document is in front?
On Thu, 23 May 2002 10:47:51, Gideon King wrote:
>
One reason you could be seeing different behaviour is if you are using a
>
different target - i.e. the one that works is being targeted directly to
>
an object, and the one that doesn't work is targeted at first responder,
>
and something further up the responder chain responds to that selector,
>
and therefore the validateMenuItem is not called on the object you
>
expect.
>
>
Gideon.
>
>
On Thursday, May 23, 2002, at 12:39 AM, Mark de Jong wrote:
>
>
A while back I posted a few messages on OmniGroup's cocoa development
>
list about problems I was having with "validateMenuItem:" not being
>
called consistently.
>
>
After poking around for a while, I wrote this:
>
>
===
>
Ok. One more piece of information. If my menu items are in a menu of my
>
own making (called "Tools"), then the menu items in that menu do make
>
it to my validateMenuItem:.
>
>
However, if I put my own menuitems in the "File" menu, then
>
"validMenuItem:" is NOT called with those items. What's so special
>
about the "File" menu?
>
>
Note that in either case, if I select the menu item, the correct target
>
is invoked.
>
>
-- Mark
>
===
>
>
Can anyone here shed some light on this?
>
>
Thanks!
>
>
-- Mark
----------------
John Nairn (1-801-581-3413, FAX: 1-801-581-4816)
Web page:
http://www.mse.utah.edu/~nairn
_______________________________________________
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.