Package org.gnome.gtk

Class ComboBoxText

java.lang.Object
All Implemented Interfaces:
Proxy, Accessible, Buildable, CellEditable, CellLayout, ConstraintTarget

@Generated("io.github.jwharm.JavaGI") @Deprecated public class ComboBoxText extends ComboBox implements Accessible, Buildable, CellEditable, CellLayout, ConstraintTarget
Deprecated.
A GtkComboBoxText is a simple variant of GtkComboBox for text-only use cases.

An example GtkComboBoxText

GtkComboBoxText hides the model-view complexity of GtkComboBox.

To create a GtkComboBoxText, use ComboBoxText() or withEntry().

You can add items to a GtkComboBoxText with appendText(java.lang.String), insertText(int, java.lang.String) or prependText(java.lang.String) and remove options with remove(int).

If the GtkComboBoxText contains an entry (via the Gtk.ComboBox:has-entry property), its contents can be retrieved using getActiveText().

You should not call ComboBox.setModel(org.gnome.gtk.TreeModel) or attempt to pack more cells into this combo box via its CellLayout 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:

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