package require twoCombobox
?1.0?
two_combobox
pathName ?options?
combobox
is an implementation
of the combobox widget known from Windows. It combines an entry widget
and a drop-down list (menu) in one widget. The drop-down list is exposed
by clicking the button on the right side of the the entry widget. This implementation adds the ability of interactively resizeing the height of the drop-down list by dragging its bottom border.
The combobox widget is available in two looks (unix and windows) and three modes (normal, fixed and disabled).
two_combobox
widget command takes the
following commands (as the first argument):
- pathName
get
- Returns entry's string (user's input).
- pathName
set
string- Sets the entry's string.
- pathName
setlist
?list?- Set the list of values in dropdown box to list.
- pathName
getlist
- Returns the list of values in dropdown box.
- pathName
add
?list?- Add list to the list of values in dropdown box.
- pathName
entry
- Returns the pathname of the embedded entry widget.
- pathName
listbox
- Returns the pathname of the embedded listbox widget.
- pathName
setFocus
- Set the focus on the proper subwidget.
two_combobox
command takes all options of the
TK entry widget plus to following options:
-command
?script?- Run the script whenever the combobox is opened (before exposing the dropdown list). Calling
return
will cause the combobox to not being opened.-state
- Specifies one of three states for the combobox: normal, fixed or disabled. Defaults to normal. If state is fixed, then the user can't edit the entry field, while still being able to select from the dropdown list. A disabled combobox can't be edited interactively.
-style
- Set the style of the Combobox:
unix
for more UNIX-like orwindows
for a look like on windows.
combobox
consists of a main frame (class TwoComboBox) with an entry widget and
a pushbutton embedded within. The dropdown list is a toplevel (append pathname .drop to widget name) with a listbox, an automatic scrollbar and a frame widget (class TwoComboDropHandle used as a handle for vertical resizeing).