Sets our main struct and passes it to the parent class.
Creates a new empty GtkComboBox.
Creates a new GtkComboBox with the model initialized to model.
Creates a new empty GtkComboBox using area to layout cells.
The changed 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 gtk_combo_box_set_active_iter(). It will also be emitted while typing into the entry of a combo box with an entry.
For combo boxes that are created with an entry (See GtkComboBox:has-entry).
The ::move-active signal is a [keybinding signal]GtkBindingSignal which gets emitted to move the active selection.
The ::popdown signal is a [keybinding signal]GtkBindingSignal which gets emitted to popdown the combo box list.
The ::popup signal is a [keybinding signal]GtkBindingSignal which gets emitted to popup the combo box list.
Returns the index of the currently active item, or -1 if there’s no active item. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns gtk_tree_path_get_indices (path)[0], where path is the #GtkTreePath of the active item.
Returns the ID of the active row of @combo_box. This value is taken from the active row and the column specified by the #GtkComboBox:id-column property of @combo_box (see gtk_combo_box_set_id_column()).
Sets @iter to point to the currently active item, if any item is active. Otherwise, @iter is left unchanged.
Gets the current value of the :add-tearoffs property.
Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.
Returns the column with column span information for @combo_box.
Get the main Gtk struct
Returns the column which @combo_box is using to get the strings from to display in the internal entry.
Returns whether the combo box grabs focus when it is clicked with the mouse. See gtk_combo_box_set_focus_on_click().
Returns whether the combo box has an entry.
Returns the column which @combo_box is using to get string IDs for values from.
Returns the #GtkTreeModel which is acting as data source for @combo_box.
Gets the accessible object corresponding to the combo box’s popup.
Gets whether the popup uses a fixed width matching the allocated width of the combo box.
Returns the current row separator function.
Returns the column with row span information for @combo_box.
the main Gtk struct as a void*
Gets the current title of the menu in tearoff mode. See gtk_combo_box_set_add_tearoffs().
Returns the wrap width which is used to determine the number of columns for the popup menu. If the wrap width is larger than 1, the combo box is in table mode.
Hides the menu or dropdown list of @combo_box.
Pops up the menu or dropdown list of @combo_box.
Pops up the menu or dropdown list of @combo_box, the popup window will be grabbed so only @device and its associated pointer/keyboard are the only #GdkDevices able to send events to it.
Sets the active item of @combo_box to be the item at @index.
Changes the active row of @combo_box to the one that has an ID equal to @active_id, or unsets the active row if @active_id is %NULL. Rows having a %NULL ID string cannot be made active by this function.
Sets the current active item to be the one referenced by @iter, or unsets the active item if @iter is %NULL.
Sets whether the popup menu should have a tearoff menu item.
Sets whether the dropdown button of the combo box should be always sensitive (%GTK_SENSITIVITY_ON), never sensitive (%GTK_SENSITIVITY_OFF) or only if there is at least one item to display (%GTK_SENSITIVITY_AUTO).
Sets the column with column span information for @combo_box to be @column_span. The column span column contains integers which indicate how many columns an item should span.
Sets the model column which @combo_box should use to get strings from to be @text_column. The column @text_column in the model of @combo_box must be of type %G_TYPE_STRING.
Sets whether the combo box will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.
Sets the model column which @combo_box should use to get string IDs for values from. The column @id_column in the model of @combo_box must be of type %G_TYPE_STRING.
Sets the model used by @combo_box to be @model. Will unset a previously set model (if applicable). If model is %NULL, then it will unset the model.
Specifies whether the popup’s width should be a fixed width matching the allocated width of the combo box.
Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is %NULL, no separators are drawn. This is the default value.
Sets the column with row span information for @combo_box to be @row_span. The row span column contains integers which indicate how many rows an item should span.
Sets the menu’s title in tearoff mode.
Sets the wrap width of @combo_box to be @width. The wrap width is basically the preferred number of columns when you want the popup to be layed out in a table.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Gets the child of the #GtkBin, or %NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.
Get the main Gtk struct
the main Gtk struct as a void*
Emits the #GtkCellEditable::editing-done signal.
Emits the #GtkCellEditable::remove-widget signal.
Begins editing on a @cell_editable. @event is the #GdkEvent that began the editing process. It may be %NULL, in the instance that editing was initiated through programatic means.
This signal is a sign for the cell renderer to update its value from the @cell_editable.
This signal is meant to indicate that the cell is finished editing, and the widget may now be destroyed.
Get the main Gtk struct
the main Gtk struct as a void*
Adds an attribute mapping to the list in @cell_layout.
Unsets all the mappings on all renderers on @cell_layout and removes all renderers from @cell_layout.
Clears all existing attributes previously set with gtk_cell_layout_set_attributes().
Returns the underlying #GtkCellArea which might be @cell_layout if called on a #GtkCellArea or might be %NULL if no #GtkCellArea is used by @cell_layout.
Returns the cell renderers which have been added to @cell_layout.
Adds the @cell to the end of @cell_layout. If @expand is %FALSE, then the @cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which @expand is %TRUE.
Packs the @cell into the beginning of @cell_layout. If @expand is %FALSE, then the @cell is allocated no more space than it needs. Any unused space is divided evenly between cells for which @expand is %TRUE.
Re-inserts @cell at @position.
Sets the #GtkCellLayoutDataFunc to use for @cell_layout.
A GtkComboBox is a widget that allows the user to choose from a list of valid choices. The GtkComboBox displays the selected choice. When activated, the GtkComboBox 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 GtkComboBox 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 GtkComboBox implements the #GtkCellLayout 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 GtkComboBox to contain a #GtkEntry. This entry can be accessed by calling gtk_bin_get_child() on the combo box.
For a simple list of textual choices, the model-view API of GtkComboBox can be a bit overwhelming. In this case, #GtkComboBoxText offers a simple alternative. Both GtkComboBox and #GtkComboBoxText can contain an entry.
CSS nodes
|[<!-- language="plain" --> combobox ├── box.linked │ ╰── button.combo │ ╰── box │ ├── cellview │ ╰── arrow ╰── window.popup ]|
A 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.
|[<!-- language="plain" --> combobox ├── box.linked │ ├── entry.combo │ ╰── button.combo │ ╰── box │ ╰── arrow ╰── window.popup ]|
A GtkComboBox 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.