![]() |
Defining menus | ![]() |
Menus, toolbars and widgets are defined using the macros below, which are implemented in
kernel/gui/menu-define.scm
. The syntax of the menu entries and the available widgets are described in detail in the chapter on widgets in Scheme, in particular in the sections menus and toolbars and widgets reference guide. See also the user manual section on creating your own dynamic menus.
(menu-bind name option … entry …)
Define (or redefine) the menu name. Both macros expand into a tm-define, so that the options for contextual overloading (such as :mode and :require) may be used, and the entry (former) includes the previous definition of the menu. The macro tm-menu in addition allows for menus with arguments. For instance:
(tm-menu (tools-menu)
(former)
---
("Say hello" (set-message "Hello" "tools menu"))) |
Similar to tm-menu, but for widgets which are to be shown in dialogue windows or side panes (see dialogs and composite widgets).
Declare that the menus name … are defined in module, which is only loaded when one of these menus is needed (or after some idle time). This mechanism is used extensively in
init-texmacs.scm
in order to speed up the boot process.
The older macro menu-extend is deprecated; use tm-menu or menu-bind together with (former) instead.