| Did you know ... | Search Documentation: |
| Instance variables |
->key, which will make the
menu behave as if this menu_item was selected if the argument key
matches this slot.Defaults: @on (active to events)
->off -condition ->active_all_items
Defaults:
@default (its
default value) will paint the menu_item in the colour of its associated menu_item<-menu.
-label -font<-active
according the this truth value.
Tested by popup->update.
Defaults: @nil
(popup->update
does not change activation status).
->off ->update -active -update_messageDefaults: @off (no line is painted).
<-label.
Normally used to realise font-selection menus.
Defaults: When @default, menu<-value_font
of the associated menu_item<-menu
is used.
The combo box of a cycle menu (see menu->kind)
shows the items in this font, or in the font of the attribute
preview_font if present. Items whose font cannot display
the label are omitted. As the size of the menu is computed using
menu_item<-font, preview_font
avoids loading the fonts of a long menu that previews many fonts.
-value_font -label -colour|image|markup]<-colour
and menu_item<-font
specified with this item. When is is an image, the menu will display
this image in menu_item<-colour.
When it is a markup
object, the menu displays the text with the fonts, colours, etc. of the
markup, on top of
menu_item<-colour
and menu_item<-font.
For example:
menu_item(save, @default, markup('<b>Save</b> all'))
The mnemonic is chosen from the text without the markup and
underlined. The list that opens from a cycle menu shows the
markup as well.
The initial value is normally computed by menu_item<-default_label
from the
menu_item<-value
by menu_item->initialise.
The menu maintains a list of menu_items manipulated in menu<-members.
-members<-message
from the associated menu_item<-menu
will be sent.
The arguments forwarded depend on the menu. See description with class menu.
<-convert
method transforms popup
objects in menu_items with this popup associated, which allows appending
popup menu's to popup menus to create pullright menus.
Defaults: @nil
<-convert <->multiple_selection.
The visual feedback is determined by
menu<->feedback.
->selection -feedback -multiple_selection
This separation is useful for two purposes. First of all menu's are
often used to select some value. For example a colour in a drawing tool.
In this case the colour
object is used as a value, while an all-1's image with is used as label
and menu_item<->colour
is set to
menu_item<->value.
When the user selects a menu-item, the colour
object to be used may be read directly from the menu_item<->value
object of the menu_item.
Second, this mechanism may be used to implement multi-language
interfaces. In this case the menu_item<->value
represents the internal name used by the program and the menu_item<->label
the external name that may be in a different language.
The default menu_item<->label
is compute from the initial menu_item<->value
using
menu_item<-default_label.
<-default_label -label