Tk Themed Widget
- matchbox - text field with popdown selection and completion lists
SYNOPSIS
-
package require Tk 9 8.6.6
package require matchbox 2.0
DESCRIPTION
-
The ttk::matchbox widget is an extension of the regular
ttk::combobox widget. It can be used wherever a ttk::combobox is currently
used, without any other changes to the code.
The difference between the ttk::matchbox widget and the ttk::combobox widget is in the interaction with the user. An empty ttk::matchbox looks just like a ttk::combobox. However, when there is any text in the ttk::matchbox, an icon appears on the right-hand side of the text field. The user can click this icon to erase the text.
WIDGET-SPECIFIC OPTIONS
-
If the -matchcommand option is specified, an additional drop-down list may be displayed showing possible completions for the entered string.
Whenever the user changes the value of the ttk::matchbox widget, the command specified via the -matchcommand option is invoked with one additional argument; the current value of the widget. The command is expected to return a list of possible completions. These will be presented to the user via the second drop-down list of the widget. If the command returns an empty list, the drop-down list will not be displayed.
Note: The match command is not invoked when the user selects an entry from the main drop-down list.
DEFAULT BINDINGS
-
The ttk::matchbox has one additional key binding, Control-u, that also erases all text in the ttk::matchbox.
COPYRIGHT
- Copyright © 2017 Schelte Bron