menucmd
(menucmd menu_item)
The menucmd function lets you enable, disable, and display menu items (cursor menu and pull-down menus).
Argument
menu_item is a string that specifies the menu item and what to do with it. The parameter uses the following format: "menu=value".
You can use the following names for menu_item:
Name |
Meaning |
P0 |
Shortcut Menu |
P1 ... Pn |
Pulldown Menu n |
M |
Macro expression |
You can use the following value parameters:
Value |
Meaning |
* |
Displays the menu. |
~ |
Disables (grays out) the menu item. |
!. |
Prefixes the menu item with a check mark. |
(blank) |
Removes properties (check mark or gray out). |
? |
Reports menu item status. |
Return Value
The function returns the result of a macro execution, the status of a menu item, or nil.
The following displays the shortcut menu:
: (menucmd "P0=*")
The following disables the second item of the forth pulldown menu:
: (menucmd "P4.2=~")
The following sets a check mark for the third item of the fifth pulldown menu:
: (menucmd "P5.3=!.")
The following removes a check mark and/or enables the third item of the fifth pulldown menu:
: (menucmd "P5.3=")
The following executes a menu macro:
: (menucmd "M=$(edtime,$(getvar,date),DDDD\",\" D MONTH YYYY)")
"Tuesday, 5 July 2011"