Gtk.ComboBoxText

A GtkComboBoxText is a simple variant of GtkComboBox that hides the model-view complexity for simple text-only use cases. To create a GtkComboBoxText, use gtk_combo_box_text_new() or gtk_combo_box_text_new_with_entry(). You can add items to a GtkComboBoxText with gtk_combo_box_text_append_text(), gtk_combo_box_text_insert_text() or gtk_combo_box_text_prepend_text() and remove options with gtk_combo_box_text_remove(). If the GtkComboBoxText contains an entry (via the 'has-entry' property), its contents can be retrieved using gtk_combo_box_text_get_active_text(). The entry itself can be accessed by calling gtk_bin_get_child() on the combo box. <refsect2 id="GtkComboBoxText-BUILDER-UI"> <title>GtkComboBoxText as GtkBuildable</title> <para> The GtkComboBoxText implementation of the GtkBuildable interface supports adding items directly using the &lt;items&gt element and specifying &lt;item&gt elements for each item. Each &lt;item&gt element supports the regular translation attributes "translatable", "context" and "comments". <example> <title>A UI definition fragment specifying GtkComboBoxText items</title> <programlisting><![CDATA[ <object class="GtkComboBoxText"> <items> <item translatable="yes">Factory</item> <item translatable="yes">Home</item> <item translatable="yes">Subway</item> </items> </object> ]]></programlisting> </example> </para> </refsect2>

Hierarchy