ComboBoxText
Deprecated since version 4.10: Use DropDown
with a StringList
instead
Superclasses: ComboBox
, Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, CellEditable
, CellLayout
, ConstraintTarget
- Constructors:
ComboBoxText(**properties)
new() -> Gtk.Widget
new_with_entry() -> Gtk.Widget
Constructors
Methods
- class ComboBoxText
- append(id: str | None, text: str) None
Appends
text
to the list of strings stored incombo_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 incombo_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. Ifcombo_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
atposition
in the list of strings stored incombo_box
.If
id
is non-None
then it is used as the ID of the row. Seeid_column
.If
position
is negative thentext
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
atposition
in the list of strings stored incombo_box
.If
position
is negative thentext
is appended.This is the same as calling
insert
with aNone
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 incombo_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 incombo_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