GNU TeXmacsUser manualReferenceAboutEnglish·Français·Deutsch·Español·Italiano·中文
定制动态菜单

定义一个名称为name的菜单,可用

(menu-bind name . def)

或者

(tm-menu (name) . def)

其中 def 是一个呈现所有菜单条目的程序。下面这个目录下的文件可供参考:

    $TEXMACS_PATH/progs/menu

其中包含了标准TeXmacs菜单的定义方式。对于tm-menu,你还可以指定额外的参数,使之根据参数动 态构建更加复杂的菜单。

更精确地说,在menu-bind或者tm-menu中的def程序实际上是如下所示形式的程序代码:

(=> "pulldown menu name" menu-definition)
(-> "pullright menu name" menu-definition)
("entry" action)
---
(if condition menu-definition)
(link variable)

函数=>和->用来创建下拉或者右拉菜单,menu-definition中要包含创建子菜单的程序。使用函数("entry" action)可创建一个菜单条目,点击entry就会执行action。菜单项之间使用---分割。函数 if 用于在满足特定的 condition 时插入菜单项。(比如说在数学模式中)

如果你声明了一个菜单 name ,那么你可以使用函数 link 间接引用该菜单。这种间接声明子菜单的方式有两个优势:

主要的TeXmacs菜单是texmacs-menu,texmacs-popup-menu,texmacs-main-icons, texmacs-mode-icons, texmacs-focus-icons和texmacs-extra-icons。其他一些标准的间接菜单是file-menu, edit-menu, insert-menu, text-menu, paragraph-menu, document-menu, options-menu和help-menu。

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".