GNU TeXmacsUser manualReferenceAboutEnglish
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 …)

(tm-menu (name arg …) option … entry …)
(define a menu)

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")))
(tm-widget (name arg …) entry …)
(define a widget)

Similar to tm-menu, but for widgets which are to be shown in dialogue windows or side panes (see dialogs and composite widgets).

(lazy-menu module name …)
(lazy loading of menus)

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.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".