The XFce Desktop Environment
Prev |  | Next

# Menus and functions

Menus and functions are quite similar from the viepoint of xfwm. A menu item defines an xfwm commands to be executed when the entry is clicked. A function also consists of a number of xfwm commands that are either executed directly or only on certain events. Functions can also be bound to keys or mouse buttons.

Table 12-1. Menus and functions

Command | Description | Example
--- | --- | ---
+ | Adds an additional item to a menu or function | (See below)
AddToMenu <mn> [<entry> <command>] | Starts the definition of a menu, or extends an existing one. An & in the entry name will create a keyboard accelerator for the next character. | AddToMenu "user_menu" + "&Xterm" Exec xterm -e tcsh
AddToFunction <fn> [<condition> <command>] | Starts the definition of a function, or extends an existing one | AddToFunc Move-or-Raise "I" Raise + "M" Move + "D" Lower
DestroyFunc <fn> | Removes an unneeded function | DestroyFunc "Move-or-Raise"
DestroyMenu <mn> | Removes an unneeded menu | DestroyMenu "Utilities"
AddToMenu <mn> <title> Title | Additional directive to the "AddToMenu" command to specify a title. The Title command makes sure that there is a separator after the title. | AddToMenu "my_menu" "My Menu" Title

A function item definition takes an event as first argument (see example in the table). The event is either a mouse action or an option to immediately execute the item. The mouse events are only meaningfull if a function is bound to a mouse button.

Recognized conditions in function definitions are:

- M : motion. Action takes effect on dragging the mouse.

- I : immediate. Action takes effect immediately.

- C : click. Action takes effect on a single mouse click.

- D : doubleclick. Action takes effect on a doubleclick of the mouse.

There are some special functions available in xfce. These functions can be customized in the same way as user defined menus.

- InitFunction : run at startup

- RestartFunction : run when restarting

- ExitFunction : run at exit

- WindowListFunc : run when entry in windowlist is pressed

By default a number of menus and functions are defined. They have no special meaning; they are just always defined when (re)starting xfwm. See XFwm Defaults for the default commands.

Prev | Home | Next
Window management | Up | XFwm commands