:right-sidebar: True ComboBoxText =================================================================== .. currentmodule:: gi.repository.Gtk .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` with a :obj:`~gi.repository.Gtk.StringList` instead .. class:: ComboBoxText(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.ComboBox`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.CellEditable`, :class:`~gi.repository.Gtk.CellLayout`, :class:`~gi.repository.Gtk.ConstraintTarget` :Constructors: :: ComboBoxText(**properties) new() -> Gtk.Widget new_with_entry() -> Gtk.Widget Constructors ------------ .. rst-class:: interim-class .. class:: ComboBoxText :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkComboBoxText``. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` .. classmethod:: new_with_entry() -> ~gi.repository.Gtk.Widget Creates a new ``GtkComboBoxText`` with an entry. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` Methods ------- .. rst-class:: interim-class .. class:: ComboBoxText :no-index: .. method:: append(id: str | None, text: str) -> None Appends ``text`` to the list of strings stored in ``combo_box``. If ``id`` is non-:const:`None` then it is used as the ID of the row. This is the same as calling :obj:`~gi.repository.Gtk.ComboBoxText.insert` with a position of -1. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param id: a string ID for this value :param text: A string .. method:: append_text(text: str) -> None Appends ``text`` to the list of strings stored in ``combo_box``. This is the same as calling :obj:`~gi.repository.Gtk.ComboBoxText.insert_text` with a position of -1. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param text: A string .. method:: get_active_text() -> str | None Returns the currently active string in ``combo_box``. If no row is currently selected, :const:`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:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` .. method:: 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-:const:`None` then it is used as the ID of the row. See :obj:`~gi.repository.Gtk.ComboBox.props.id_column`. If ``position`` is negative then ``text`` is appended. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param position: An index to insert ``text`` :param id: a string ID for this value :param text: A string to display .. method:: 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 :obj:`~gi.repository.Gtk.ComboBoxText.insert` with a :const:`None` ID string. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param position: An index to insert ``text`` :param text: A string .. method:: prepend(id: str | None, text: str) -> None Prepends ``text`` to the list of strings stored in ``combo_box``. If ``id`` is non-:const:`None` then it is used as the ID of the row. This is the same as calling :obj:`~gi.repository.Gtk.ComboBoxText.insert` with a position of 0. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param id: a string ID for this value :param text: a string .. method:: prepend_text(text: str) -> None Prepends ``text`` to the list of strings stored in ``combo_box``. This is the same as calling :obj:`~gi.repository.Gtk.ComboBoxText.insert_text` with a position of 0. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param text: A string .. method:: remove(position: int) -> None Removes the string at ``position`` from ``combo_box``. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown` :param position: Index of the item to remove .. method:: remove_all() -> None Removes all the text entries from the combo box. .. deprecated:: 4.10 Use :obj:`~gi.repository.Gtk.DropDown`