macStatusMenuSet
Type
handler
Summary
Set a property on a status menu
Syntax
macStatusMenuSet(<pName>,<pProperty>,<pValue>)
Description
Specify the menu items in the following form:
[flags] label [\'/\' accelerator [\'|\' tag]]
Where flags may include:
!c, !n, !m: the menu item has respectively, a check, no check, or a mixed state icon
- A difference between standard LiveCode menus and the macStatusMenu library is that the radio button (!r) used in LiveCode menus is not supported, however, the mixed state (!m) is. Additionally you can use the macStatusMenuSetCustomIcon command to specify a custom icon.
(: the menu item is disabled
-: the menu item is replaced with a menu separator
multiple tab characters: the number of tabs specifes the depth of the menu item; use this to create submenus
The accelerator can be specified as one of: char:Command key + specified char keyname:Named key without modifiers modifiers char: Specified modifiers + character modifiers keyname: Specified modifiers + named key In the accelerator, modifiers is either a space separated list of:
- 'command' or 'cmd'
- 'control' or 'ctrl'
- 'option' or 'opt', 'alt', 'shift'
In this case the keyname/char should be separated from the list by a space
Or modifiers may be a sequence of characters, including:
^: Command @: Shift #: Option %: Control
In this case no space between the sequence and keyname/char is required
The following named keys are supported:
F1, F2, F3, F4, ... F15, Left, Up, Right, Down, Backspace, Delete, Tab, Space, Return, Enter, Home, End, Escape, PgUp, PgDown
A tag can be specified as a | character followed by a string of ASCII characters. If such a tag is present then that tag will take the place of the menu label as the parameter to the menuPick.
A tag will only be recognised following the accelerator. To specify a menu tag without an accelerator shortcut, an empty accelerator can be specified using /| followed by the tag text.
Parameters
Name | Type | Description |
---|---|---|
pName | The name of a previously created status menu | |
pProperty |
| |
pValue | The value as described for each property |
Examples
on EnableStatusMenu pEnabled
macStatusMenuSet "mymenu", "enabled", pEnabled
if pEnabled then
macStatusMenuSet "mymenu", "icon", the long id of image "enabled"
macStatusMenuSet "mymenu", "items", "Open" & return & "-" & return & "Settings"
else
macStatusMenuSet "mymenu", "icon", the long id of image "disabled"
macStatusMenuSet "mymenu", "items", empty
end if
end EnableStatusMenu
Related
handler: macStatusMenuSetCustomIcon
Compatibility and Support
OS
mac
Platforms
desktop