Creates a new #GtkComboBoxText, which is a #GtkComboBox just displaying strings.
Appends text to the list of strings stored in combo_box. If id is non-null then it is used as the ID of the row.
Appends text to the list of strings stored in combo_box.
Returns the currently active string in combo_box, or null if none is selected. If combo_box contains an entry, this function will return its contents (which will not necessarily be an item from the list).
Inserts text at position in the list of strings stored in combo_box. If id is non-null then it is used as the ID of the row. See #GtkComboBox:id-column.
Inserts text at position in the list of strings stored in combo_box.
Prepends text to the list of strings stored in combo_box. If id is non-null then it is used as the ID of the row.
Prepends text to the list of strings stored in combo_box.
Removes the string at position from combo_box.
Removes all the text entries from the combo box.
Returns this, for use in with statements.
Get builder for gtk.combo_box_text.ComboBoxText
Creates a new #GtkComboBoxText, which is a #GtkComboBox just displaying strings. The combo box created by this function has an entry.
Returns this, for use in with statements.
Get builder for gtk.combo_box.ComboBox
Get active property.
Set active property.
Get activeId property.
Set activeId property.
Get addTearoffs property.
Set addTearoffs property.
Get buttonSensitivity property.
Set buttonSensitivity property.
Get cellArea property.
Get columnSpanColumn property.
Set columnSpanColumn property.
Get entryTextColumn property.
Set entryTextColumn property.
Get hasEntry property.
Get hasFrame property.
Set hasFrame property.
Get idColumn property.
Set idColumn property.
Get model property.
Set model property.
Get popupFixedWidth property.
Set popupFixedWidth property.
Get popupShown property.
Get rowSpanColumn property.
Set rowSpanColumn property.
Get tearoffTitle property.
Set tearoffTitle property.
Get wrapWidth property.
Set wrapWidth property.
Creates a new empty #GtkComboBox using area to layout cells.
Creates a new empty #GtkComboBox with an entry.
Creates a new empty #GtkComboBox with an entry.
Creates a new #GtkComboBox with the model initialized to model.
Creates a new empty #GtkComboBox with an entry and with the model initialized to model.
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.ComboBox.setIdColumn).
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.
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.ComboBox.setFocusOnClick.
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 column with row span information for combo_box.
Gets the current title of the menu in tearoff mode. See gtk.combo_box.ComboBox.setAddTearoffs.
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.types.SensitivityType.On), never sensitive (gtk.types.SensitivityType.Off) or only if there is at least one item to display (gtk.types.SensitivityType.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.
Connect to Changed signal.
Connect to FormatEntryText signal.
Connect to MoveActive signal.
Connect to Popdown signal.
Connect to Popup signal.
A GtkComboBoxText is a simple variant of #GtkComboBox that hides the model-view complexity for simple text-only use cases.
To create a GtkComboBoxText, use gtk.combo_box_text.ComboBoxText.new_ or gtk.combo_box_text.ComboBoxText.newWithEntry.
You can add items to a GtkComboBoxText with gtk.combo_box_text.ComboBoxText.appendText, gtk.combo_box_text.ComboBoxText.insertText or gtk.combo_box_text.ComboBoxText.prependText and remove options with gtk.combo_box_text.ComboBoxText.remove.
If the GtkComboBoxText contains an entry (via the “has-entry” property), its contents can be retrieved using gtk.combo_box_text.ComboBoxText.getActiveText. The entry itself can be accessed by calling gtk.bin.Bin.getChild on the combo box.
You should not call gtk.combo_box.ComboBox.setModel or attempt to pack more cells into this combo box via its GtkCellLayout interface.
GtkComboBoxText as GtkBuildable
The GtkComboBoxText implementation of the GtkBuildable interface supports adding items directly using the <items> element and specifying <item> elements for each item. Each <item> element can specify the “id” corresponding to the appended text and also supports the regular translation attributes “translatable”, “context” and “comments”.
Here is a UI definition fragment specifying GtkComboBoxText items:
CSS nodes
combobox ╰── box.linked ├── entry.combo ├── button.combo ╰── window.popupGtkComboBoxText has a single CSS node with name combobox. It adds the style class .combo to the main CSS nodes of its entry and button children, and the .linked class to the node of its internal box.