[comp.soft-sys.andrew] Quit menu item

grogers@BULLWINKLE.CS.UIUC.EDU (Greg Rogers) (10/12/89)

I have an application which creates several windows (im's).  I'd like to
prevent the user from quitting from all but one of these windows.  However,
I can't seem to delete the im's Quit menu item.   I do have one window with
no menus.  I want a window with menus, but no Quit;  this I can't figure out
how to get.  I know about menu masks. But, im's menus don't have masks so they
can't be masked out.  How can I do this?

Greg Rogers
University of Illinois at Urbana-Champaign
Department of Computer Science
1304 W. Springfield Ave.
Urbana, IL 61801

grogers@cs.uiuc.edu

bader+@ANDREW.CMU.EDU (Miles Bader) (10/13/89)

grogers@bullwinkle.cs.uiuc.edu (Greg Rogers) writes:
> I have an application which creates several windows (im's).  I'd like to
> prevent the user from quitting from all but one of these windows.  However,
> I can't seem to delete the im's Quit menu item.  I do have one window with
> no menus.  I want a window with menus, but no Quit; this I can't figure out
> how to get.  I know about menu masks. But, im's menus don't have masks so
> they can't be masked out.  How can I do this?

In whatever view is underneath the im (your application view), include a
menu-entry with the name "Quit" and a NULL proc (the proctable entry
pointer).  This will obscure the im entry, and since the proc is NULL, won't
show up on the menus.  You can do the same thing with a keymap entry (since
im handles ^X^C).

Reposting your menus without the NULL "Quit" entry (or with it disabled via
the mask bits) will get back the im "Quit."

A typical bind list entry to do this is:

    {NULL, "\030\003", 0, "Quit", 0, 0}

-Miles