kombobox widget
Usage:
kombobox widget-path ?options?
Options
- -expand boolean
- If boolean is yes, true or on the combobox
widget can be expanded when it is finally packed, otherwise the widget
has a fixed width. Defaults to ``true''.
- -width chars
- Sets the width of the combobox to chars. Note; you cannot
use this option together with -expand.
- -editable boolean
- If boolean is yes, true or on the combobox's
displayed value can be edited, otherwise it is read-only and can only
be changed by the user using the drop-down choice box.
Defaults to read-only. This option may be abbreviated to -edit.
- -height items
- sets the number of items displayed in the drop-down choice box. If there
are more than items in the choice list, a scroll bar is provided.
Default number of items is 10.
- -justify left|center|right
- sets the justify mode for the value displayed by the non-editable
combobox. Defaults to centre. Editable combobox values are always
displayed left-justified.
- -showvalue text
- defines the value to be displayed by the combobox. This option
may be abbreviated to -value.
- -list list
- initialises the choicebox list. Whenever <Return> is pressed
in the editable combobox, the new value is appended to the list. The
kombobox's choice-list may be read at any time using the ``cget -list''
widget command.
- -command script
- script is executed whenever a value is chosen from the
drop-down choice box, or <Return> is pressed in the editable text window.
- -state normal|disabled
- sets the state of the combobox.
Widget Commands
In addition to the standard ``cget'' and ``configure'' commands,
the kombobox widget provides the following specialised commands;
- post
- arranges to display the choicebox as if the user had clicked the
right-hand button.
- unpost
- closes the choicebox.
- selectionindex
-
Returns the list index of the last selected item from the choice box.
Returns -1 if no selection index is available.
To find the value currently displayed by the comboxbox, use the cget
widget command and read the value of showvalue.
Ktk is maintained by
Andrew F. Lack
This page was last updated on 22nd March 1999