Re: Quit menu item undimming itself?!
Re: Quit menu item undimming itself?!
- Subject: Re: Quit menu item undimming itself?!
- From: James Bucanek <email@hidden>
- Date: Tue, 9 May 2006 12:13:16 -0700
John Stiles wrote on Tuesday, May 9, 2006:
>I have a Cocoa app which, soon after applicationDidFinishLaunching is
>called, creates a window and dims the Quit menu item via
> [quitMenuItem setEnabled:NO];
>
>(It's bound in my nib, of course.) I can check it immediately
>afterwards and it's still dim:
> [quitMenuItem setEnabled:NO];
> ASSERT( ![quitMenuItem isEnabled] ); // OK!
>
>But if I check the menu, it's not dimmed.
>Sure enough, I put some code in our "main loop" to poll the state,
>and it is very quickly returning back to "enabled" state.
>I only have one other place in the code where I change the enable
>state back to true; I put a breakpoint there, and it's not firing.
>
>Who could be undimming my quit item?! Could Cocoa be doing this
>behind my back?
This is not the way to dim menus. Go to the Cocoa documentation section of Xcode and search or "responder chain". Once you understand about the responder chain, read the documentation for validateMenuItem:.
--
James Bucanek
_______________________________________________
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