ComboBoxText


Object Hierarchy:

Gtk.ComboBoxText Gtk.ComboBoxText Gtk.ComboBoxText Gtk.ComboBox Gtk.ComboBox Gtk.ComboBox->Gtk.ComboBoxText Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.ComboBox GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.ComboBoxText Gtk.Accessible->Gtk.ComboBox Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.ComboBoxText Gtk.Buildable->Gtk.ComboBox Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.ComboBoxText Gtk.ConstraintTarget->Gtk.ComboBox Gtk.ConstraintTarget->Gtk.Widget Gtk.CellEditable Gtk.CellEditable Gtk.CellEditable->Gtk.ComboBoxText Gtk.CellEditable->Gtk.ComboBox Gtk.CellLayout Gtk.CellLayout Gtk.CellLayout->Gtk.ComboBoxText Gtk.CellLayout->Gtk.ComboBox

Description:

[ CCode ( type_id = "gtk_combo_box_text_get_type ()" ) ]
public class ComboBoxText : ComboBox, Accessible, Buildable, CellEditable, CellLayout, ConstraintTarget

A `GtkComboBoxText` is a simple variant of `GtkComboBox` for text-only use cases.

![An example GtkComboBoxText](combo-box-text.png)

`GtkComboBoxText` hides the model-view complexity of `GtkComboBox`.

To create a `GtkComboBoxText`, use [[email protected]] or [[email protected]_with_entry].

You can add items to a `GtkComboBoxText` with [[email protected]_text], [[email protected]_text] or [ [email protected]_text] and remove options with [[email protected]].

If the `GtkComboBoxText` contains an entry (via the [[email protected]:has-entry] property), its contents can be retrieved using [ [email protected]_active_text].

You should not call [[email protected]_model] or attempt to pack more cells into this combo box via its [[email protected]] 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: ```xml <object class="GtkComboBoxText"> <items> < item translatable="yes" id="factory">Factory</item> <item translatable="yes" id="home">Home</item> <item translatable="yes" id="subway">Subway</item> </items> </object> ```

CSS nodes

``` combobox ╰── box.linked ├── entry.combo ├── button.combo ╰── window.popup ```

`GtkComboBoxText` 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.


Namespace: Gtk
Package: gtk4

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Gtk.CellEditable



2022 vala-language.org