Wrapper class for menu items
callback | inactive | label | shortcut | value |
divider | invisible | radio | toggle | |
get_value | redraw | set_value |
type | name | summary |
string | label | Path and label |
function | callback | Called when chosen |
type | name | summary |
void | redraw() | Update the menu item state |
Menu_Entry wraps the creation and maintenance of menu items in Menu_ subclasses. It compensates for the lack of a Lua binding to Fl_Menu_Item
To create them, call their constructor Menu_Entry{"your label"}. Once added to a Menu_, they're associated with that menu; don't add them again elsewhere.
Changes to properties won't take effect until you call redraw() on the entry.
The label to display for this entry. It also specifies the place in the menu hierarchy. For example, a label of "Edit/Paste" will place an entry displayed as Paste in the Edit menu.
Note that you should not create an entry labeled "Edit" in this case; it will be properly created as a submenu for you.
'&' shortcuts may be included. See Button's label property for
more information.
callback will be called when the item is chosen. If
callback is nil, the Menu_'s callback will
be invoked instead.
Selects whether the item is disabled. Disabled items are grayed out and cannot be picked.
Controls whether the item is a check button. Check buttons have a box
drawn adjacent to them; chosing one toggles its value. See get_value() and set_value()
Controls whether the item is a radio button. Radio button have a box
drawn adjacent to them. When a radio button is
selected all "adjacent" radio buttons are turned off. A set of radio
items is delimited by a non-radio item, or by an
item with divider turned on.. See get_value() and set_value()
Note that you must manually deselect other radio buttons in the
group before selecting one programmatically.
Controls whether the item is shown.
If divider is true, a menu divider is drawn after this item.
For radio and check buttons, choose whether the entry is selected.
This is really only useful in constructors as it lags behind the menu
state. Use get_value() and set_value() instead.
Controls the keyboard trigger for the menu item. shortcut
is an integer consisting of an ASCII character or extended keycode,
with modifiers. strbyte('a')+Modifier.ctrl is Ctrl-A;
Key.insert+Modifier.shift is Shift-Insert. See Key
and Modifier for more information.
Returns true if the item (presumably a check or radio button) is selected.
Sets the value flag of the item (presumably a check or radio button)
to b. redraw() is called for you.
Note that this does not turn off other members of a radio group; turn them off by hand before turning another on programatically
A Menu_Entry is only a wrapper for an item in a menu.
After modifying the state, call redraw() to force changes
into the real menu.
callback: function
inactive: boolean
toggle: boolean
radio: boolean
invisible: boolean
divider: boolean
value: boolean
shortcut: integer
get_value(): boolean
set_value(boolean b): void
redraw(): void
doctool generated at Sun Aug 12 22:23:18 2001