Package: gtk
Class gtk-combo-box
Superclassesgtk-bin, gtk-container, gtk-widget, gtk-buildable, gtk-cell-editable, gtk-cell-layout, g-object, common-lisp:standard-object, common-lisp:t Documented SubclassesDirect SlotsDetails A gtk-combo-box widget allows the user to choose from a list of valid
choices. The gtk-combo-box widget displays the selected choice. When activated, the gtk-combo-box widget displays a popup which allows the user to make
a new choice. The style in which the selected value is displayed, and the
style of the popup is determined by the current theme. It may be similar to a
Windows style combo box. The gtk-combo-box widget uses the model-view pattern. The list of valid choices is specified in the form of a tree model, and the display of the choices can be adapted to the data in the model by using cell renderers, as you would in a tree view. This is possible since the gtk-combo-box class implements the gtk-cell-layout interface. The tree model holding the valid choices is not restricted to a flat list, it can be a real tree, and the popup will reflect the tree structure. To allow the user to enter values not in the model, the has-entry property allows the gtk-combo-box widget to contain a gtk-entry widget. This entry can be accessed by calling the function gtk-bin-child on the combo box. For a simple list of textual choices, the model-view API of the gtk-combo-box widget can be a bit overwhelming. In this case, the gtk-combo-box-text widget offers a simple alternative. Both the gtk-combo-box widget and the gtk-combo-box-text widget can contain an entry. CSS nodesCSS nodes combobox ├── box.linked │ ╰── button.combo │ ╰── box │ ├── cellview │ ╰── arrow ╰── window.popupA normal combobox contains a box with the .linked class, a button with the .combo class and inside those buttons, there are a cellview and an arrow. combobox ├── box.linked │ ├── entry.combo │ ╰── button.combo │ ╰── box │ ╰── arrow ╰── window.popupA gtk-combo-box widget with an entry has a single CSS node with name combobox. It contains a box with the .linked class. That box contains an entry and a button, both with the .combo class added. The button also contains another node with name arrow. Style Property Details
Signal DetailsThe "changed" signallambda (combo) : Run LastThe signal is emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to the function gtk-combo-box-active-iter. It will also be emitted while typing into the entry of a combo box with an entry.
The "format-entry-text" signallambda (combo pathstr) : Run LastA signal which allows you to change how the text displayed in a combo box's entry is displayed. Connect a signal handler which returns an allocated string representing path. That string will then be used to set the text in the combo box's entry. The default signal handler uses the text from the entry-text-column property model column. Here is an example signal handler which fetches data from the model and displays it in the entry. For combo boxes that are created with an entry. See the has-entry property. (defun format-entry-text-callback (combo pathstr) (let* ((model (gtk-combo-box-model combo)) (iter (gtk-tree-model-iter-from-string model pathstr)) (value (gtk-tree-model-value model iter col-value))) (format nil "~a" value)))
The "move-active" signallambda (combo scroll) : ActionA keybinding signal which gets emitted to move the active selection.
The "popdown" signallambda (combo) :actionA keybinding signal which gets emitted to popdown the combo box list. The default bindings for this signal are the Alt+Up and Escape keys.
The "popup" signallambda (combo) :actionA keybinding signal which gets emitted to popup the combo box list. The default binding for this signal is the Alt+Down key.
| Slot Access FunctionsInherited Slot Access FunctionsSee also |
*2021-3-13