Disable OSX App's menu? - have to do it; it's another bug

Barry Levine themacguy at macosx.com
Mon Sep 8 09:25:00 EDT 2003


Alex,

When you select "Quit" (with a modal dialog in the foreground - and the 
"ask" or "answer" command has always been modal), the app does not quit 
-but- it won't respond to that menu item ever again (during that 
session). In other words, you have to force-quit the app.

> Barry, I haven't tried this, but can you disable in particular the Quit
> menu item in the app menu?

No. That's part of the problem: Rev doesn't let you disable the "Quit" 
item because it's not part of the Rev menubar; it's OSX's. Well, 
technically I guess it does belong to Rev because of what Rev 
automatically does to the File menu (removing the last two items) in 
OSX.
>
> I just looked in Mail.app (what I'm using right now of course), and
> with a model dialog open, Mail.app does allow it's app menu to be
> opened, however almost all of the menu items are disabled, including
> Quit.

I'm using Mail now. When I bring up the Print dialog, for example 
(which comes down as a sheet), all items in the Mail menu are 
selectable (and "Hide Mail" does, indeed, hide the program), but "Quit" 
has no effect which, of course, is exactly the correct functionality 
you would expect. We're in the middle of a modal dialog; Quitting is 
inappropriate. I'm being forced to hide the menubar (which looks like 
hell).
>
> The general rule is: the developer is required to enable/disable menu
> items as appropriate.

Generally, yes. However, a modal dialog is a special case. By 
definiftion, it's "modal" and everything else related to that app 
should be put on hold, so to speak. Go back to HyperCard, call up the 
"answer" dialog, and see if HC will let you select the Quit menuitem. 
No way. You may "hide" the app (even in OS9).

Nevertheless, if this is what I must do, I'll do it...once Rev has a 
means to do so. Remember: in OSX, Rev removes your ability to do 
anything with the "last two items" in the File menu because it removes 
those last two items and creates them in the app menu. But these are 
NOT the items from your File menu that you so carefully crafted; they 
are Rev's creation and you have no control over them (so it seems). You 
have to add your own "shutDownRequest" handler to the stack to take 
care of the OSX Quit item even if you had such a handler in your menu 
(because the last two items in your file menu are ignored including 
their handlers!).

> Not even Cocoa (Apple's own application framework) will disable the
> Quit menu automatically for you.

If you do any Cocoa development, create an app with a modal dialog. 
When that dialog is "up", see if you can quit. I'll bet you can't. You 
can "hide" the app, of course, but quitting is an inappropriate action 
in the middle of a modal activity.

I filed bug report #567 over this issue.

Regards,
Barry





More information about the use-livecode mailing list