ComboBoxText

Deprecated since version 4.10: Use DropDown with a StringList instead

class ComboBoxText(**properties: Any)

Superclasses: ComboBox, Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, CellEditable, CellLayout, ConstraintTarget

Constructors:

ComboBoxText(**properties)
new() -> Gtk.Widget
new_with_entry() -> Gtk.Widget

Constructors

class ComboBoxText
classmethod new() Widget

Creates a new GtkComboBoxText.

Deprecated since version 4.10: Use DropDown

classmethod new_with_entry() Widget

Creates a new GtkComboBoxText with an entry.

Deprecated since version 4.10: Use DropDown

Methods

class ComboBoxText
append(id: str | None, text: str) None

Appends text to the list of strings stored in combo_box.

If id is non-None then it is used as the ID of the row.

This is the same as calling insert with a position of -1.

Deprecated since version 4.10: Use DropDown

Parameters:
  • id – a string ID for this value

  • text – A string

append_text(text: str) None

Appends text to the list of strings stored in combo_box.

This is the same as calling insert_text with a position of -1.

Deprecated since version 4.10: Use DropDown

Parameters:

text – A string

get_active_text() str | None

Returns the currently active string in combo_box.

If no row is currently selected, None is returned. If combo_box contains an entry, this function will return its contents (which will not necessarily be an item from the list).

Deprecated since version 4.10: Use DropDown

insert(position: int, id: str | None, text: str) None

Inserts text at position in the list of strings stored in combo_box.

If id is non-None then it is used as the ID of the row. See id_column.

If position is negative then text is appended.

Deprecated since version 4.10: Use DropDown

Parameters:
  • position – An index to insert text

  • id – a string ID for this value

  • text – A string to display

insert_text(position: int, text: str) None

Inserts text at position in the list of strings stored in combo_box.

If position is negative then text is appended.

This is the same as calling insert with a None ID string.

Deprecated since version 4.10: Use DropDown

Parameters:
  • position – An index to insert text

  • text – A string

prepend(id: str | None, text: str) None

Prepends text to the list of strings stored in combo_box.

If id is non-None then it is used as the ID of the row.

This is the same as calling insert with a position of 0.

Deprecated since version 4.10: Use DropDown

Parameters:
  • id – a string ID for this value

  • text – a string

prepend_text(text: str) None

Prepends text to the list of strings stored in combo_box.

This is the same as calling insert_text with a position of 0.

Deprecated since version 4.10: Use DropDown

Parameters:

text – A string

remove(position: int) None

Removes the string at position from combo_box.

Deprecated since version 4.10: Use DropDown

Parameters:

position – Index of the item to remove

remove_all() None

Removes all the text entries from the combo box.

Deprecated since version 4.10: Use DropDown