ComboBox

ComboBox is a combination of a text field and drop-down list. This example has a default value, two choices, and it is editable.

<combobox text="ComboBox">
  <choice text="Choice" icon="image.gif" />
  <choice text="Disabled" enabled="false" />
</combobox>

Properties
NameTypeDefaultDescription
iconicon The icon image that the combobox displays.
selectedinteger-1The index of the currently selected choice, value -1 indicates a custom edited value in an editable box.
text, columns, editable, and alignment parameters are described at textfield
name, enabled, visible, tooltip, property, i18n, width, height, colspan, rowspan, weightx, weighty, halign, and valign parameters are similar to component
Listeners
NameDescription
actionInvokes the given method when there was change in the text or a new choice was selected.

Choice

The drop down list of a combobox contains choices. The popup combolist internally handles scrolling.

Properties
NameTypeDefaultDescription
namestring Identifies the item.
enabledbooleantrueEnables or disables the item. A disabled item is painted gray, and can't be selected by mouse or keyboard.
textstring The text text that the choice displays.
iconicon The icon image that the choice displays.
alignmentchoiceleftThe alignment of the text and image similar to label. Possible values are: left, center, and right.
tooltipstring The text pops up when the mouse lingers inside this specified part of the component, otherwise the tooltip text of the component.
fontfont Custom font to use for text.
foregroundcolor Custom foreground (text) color.
backgroundcolor Custom background color.
propertyproperty Adds an arbitrary key/value client property (or properties) stored in a hashtable of the item.
Keyboard-actions
OperationAction
Spacebar, Down arrowPost menu
Up arrowSelects previous (or last) choice
Down arrowSelects next (or first) choice
HomeSelects first choice
EndSelects last choice
Page UpSelects choice one view up
Page DownSelects choice one view down
Enter, Return, SpacebarActivates selection, and retract menu
EscapeRetract menu without taking selection
Tab, Shift-TabNavigate forward, backward