A ttk::combobox combines a text field with a pop-down list of values; the user may select the value of the text field from among the values in the list.
-class -cursor-takefocus -style
See the ttk_widget manual entry for details on the standard options.
Command-Line Name:-exportselection Database Name:exportSelection Database Class:ExportSelection
Command-Line Name:-justify Database Name:justify Database Class:Justify
Command-Line Name:-height Database Name:height Database Class:Height
Command-Line Name:-postcommand Database Name:postCommand Database Class:PostCommand
Command-Line Name:-state Database Name:state Database Class:State
Command-Line Name:-textvariable Database Name:textVariable Database Class:TextVariable
Command-Line Name:-values Database Name:values Database Class:Values
Command-Line Name:-width Database Name:width Database Class:Width
The following subcommands are possible for combobox widgets:
The combobox widget also supports the following ttk::entry widget subcommands (see ttk::entry(n) for details):
bbox deleteicursor index insertselection xview
The combobox widget also supports the following generic ttk::widget widget subcommands (see ttk::widget(n) for details):
cget configureidentify instate state
The combobox widget generates a <<ComboboxSelected>> virtual event when the user selects an element from the list of values. If the selection action unposts the listbox, this event is delivered after the listbox is unposted.
The class name for a ttk::combobox is TCombobox. The ttk::combobox uses the entry and listbox widgets internally. The listbox frame has a class name of ComboboxPopdownFrame.
Dynamic states: disabled, focus, pressed, readonly.
TCombobox styling options configurable with ttk::style are:
-arrowcolor color
-arrowsize amount
-background color
-bordercolor color
-darkcolor color
-focusfill color
-foreground color
-fieldbackground color
The ttk::combobox popdown listbox cannot be configured using ttk::style nor via the widget configure command. The listbox can be configured using the option database.
option add *TCombobox*Listbox.background color
option add *TCombobox*Listbox.font font
option add *TCombobox*Listbox.foreground color
option add *TCombobox*Listbox.selectBackground color
option add *TCombobox*Listbox.selectForeground color
To configure a specific listbox (subject to future change):
set popdown [ttk::combobox::PopdownWindow .mycombobox] $popdown.f.l configure -font font
ComboboxPopdownFrame styling options configurable with ttk::style are:
-borderwidth amount
-relief relief
Some options are only available for specific themes.
See the ttk::style manual page for information on how to configure ttk styles.