[comp.windows.x.motif] How are menu accelerators specified for custom Mwm menus?

grp@unify.COM (Greg Pasquariello) (07/27/90)

Rich Thomson writes:
>Is it possible to define menu accelerators for menus you create in Mwm?
>How does one specify them?  Thanks in advance...
>					-- Rich

Yes.  The syntax for a menu is

	Menu	menu-name
	{
		label  mnemonic  accelerator  function
				.
				.
				.
	}

The mnemonic is the part of the label that gets the underscore, and the 
accelerator is the key that invokes the action.  The mnemonic looks like

	_c

where the 'c' is the character to be underlined.

A real menu (that I use, and is pretty much the standard) looks like:

Menu DefaultWindowMenu MwmWindowMenu
{
    "Window Menu"			f.title
    "Restore"	_R	Alt<Key>F5	f.normalize
    "Minimize"	_n	Alt<Key>F9	f.minimize
    "Maximize"	_x	Alt<Key>F6	f.maximize
    "Move"	_M	Alt<Key>F7	f.move
    "Size"	_S	Alt<Key>F8	f.resize
    "Lower"	_L	Alt<Key>F3	f.lower
    no-label				f.separator
    "Quit"	_Q	Alt<Key>F4	f.kill
}



>Rich Thomson	thomson@cs.utah.edu  {bellcore,hplabs,uunet}!utah-cs!thomson
>``If everybody is thinking the same thing, is anybody thinking?'' --Bob Johnson
>
>


-Greg Pasquariello	grp@unify.com