| Home ⋅ All Commands ⋅ Grouped Commands ⋅ List of all modules ⋅ FAQ (on line) |

## Popup

`Popup` `PopupName` [`position`] [`default-action`]

This command has two purposes: to bind a menu to a key or mouse button, and to bind a sub menu into a menu. The formats for the two purposes differ slightly. The `position` arguments are the same as for Menu. The command `default-action` is invoked if the user clicks a button to invoke the menu and releases it immediately again (or hits the key rapidly twice if the menu is bound to a key). If the default action is not specified, double clicking on the menu does nothing. However, if the menu begins with a menu item (i.e. not with a title or a separator) and the default action is not given, double clicking invokes the first item of the menu (but only if the pointer really was over the item).

To bind a previously defined pop-up menu to a key or mouse button:

The following example binds mouse buttons 2 and 3 to a pop-up called "Window Ops". The menu pops up if the buttons 2 or 3 are pressed in the window frame, side-bar, or title-bar, with no modifiers (none of shift, control, or meta).

    Mouse 2 FST N Popup "Window Ops"
    Mouse 3 FST N Popup "Window Ops"

Pop-ups can be bound to keys through the use of the Key command. Pop-ups can be operated without using the mouse by binding to keys and operating via the up arrow, down arrow, and enter keys.

To bind a previously defined pop-up menu to another menu, for use as a sub menu:

The following example defines a sub menu "Quit-Verify" and binds it into a main menu, called "RootMenu":

    AddToMenu Quit-Verify
     + "Really Quit Fvwm?" Title
     + "Yes, Really Quit"  Quit
     + "Restart Fvwm"      Restart
     + "Restart Fvwm 1.xx" Restart fvwm1 -s
     + ""                  Nop
     + "No, Don't Quit"    Nop

    AddToMenu RootMenu "Root Menu" Title
     + "Open XTerm Window" Popup NewWindowMenu
     + "Login as Root"     Exec exec xterm -T Root -n Root -e su -
     + "Login as Anyone"   Popup AnyoneMenu
     + "Remote Hosts"      Popup HostMenu
     + ""                  Nop
     + "X utilities"       Popup Xutils
     + ""                  Nop
     + "Fvwm Modules"      Popup Module-Popup
     + "Fvwm Window Ops"   Popup Window-Ops
     + ""                  Nop
     + "Previous Focus"    Prev (AcceptsFocus) Focus
     + "Next Focus"        Next (AcceptsFocus) Focus
     + ""                  Nop
     + "Refresh screen"    Refresh
     + ""                  Nop
     + "Reset X defaults"  Exec xrdb -load \
                           $HOME/.Xdefaults
     + ""                  Nop
     + ""                  Nop
     + Quit                Popup Quit-Verify

Popup differs from Menu in that pop-ups do not stay up if the user simply clicks. These are popup-menus, which are a little hard on the wrist. Menu menus stay up on a click action. See the Menu command for an explanation of the interactive behavior of menus. A menu can be open up to ten times at once, so a menu may even use itself or any of its predecessors as a sub menu.

fvwm 2.6.8