Synopsis
#include <gtk/gtk.h>
GtkComboBoxEntry;
GtkWidget* gtk_combo_box_entry_new (void);
GtkWidget* gtk_combo_box_entry_new_with_model (GtkTreeModel *model,
gint text_column);
GtkWidget* gtk_combo_box_entry_new_text (void);
void gtk_combo_box_entry_set_text_column (GtkComboBoxEntry *entry_box,
gint text_column);
gint gtk_combo_box_entry_get_text_column (GtkComboBoxEntry *entry_box);
Object Hierarchy
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBin
+----GtkComboBox
+----GtkComboBoxEntry
Implemented InterfacesGtkComboBoxEntry implements AtkImplementorIface, GtkBuildable, GtkCellEditable and GtkCellLayout. DescriptionA GtkComboBoxEntry is a widget that allows the user to choose from a list of valid choices or enter a different value. It is very similar to a GtkComboBox, but it displays the selected value in an entry to allow modifying it.
In contrast to a GtkComboBox, the underlying model of a GtkComboBoxEntry
must always have a text column (see
The changed signal will be emitted while typing into a GtkComboBoxEntry,
as well as when selecting an item from the GtkComboBoxEntry's list. Use
Connect to the activate signal of the GtkEntry (use
The convenience API to construct simple text-only GtkComboBoxes
can also be used with GtkComboBoxEntrys which have been constructed
with
If you have special needs that go beyond a simple entry (e.g. input validation),
it is possible to replace the child entry by a different widget using
GtkComboBoxEntry as GtkBuildableBeyond the <attributes> support that is shared by all GtkCellLayout implementation, GtkComboBoxEntry makes the entry available in UI definitions as an internal child with name "entry". Detailsgtk_combo_box_entry_new ()GtkWidget* gtk_combo_box_entry_new (void);
Creates a new GtkComboBoxEntry which has a GtkEntry as child. After
construction, you should set a model using
Since 2.4 gtk_combo_box_entry_new_with_model ()GtkWidget* gtk_combo_box_entry_new_with_model (GtkTreeModel *model, gint text_column);
Creates a new GtkComboBoxEntry which has a GtkEntry as child and a list
of strings as popup. You can get the GtkEntry from a GtkComboBoxEntry
using GTK_ENTRY (GTK_BIN (combo_box_entry)->child). To add and remove
strings from the list, just modify
Since 2.4 gtk_combo_box_entry_new_text ()GtkWidget* gtk_combo_box_entry_new_text (void);
Convenience function which constructs a new editable text combo box, which
is a GtkComboBoxEntry just displaying strings. If you use this function to
create a text combo box, you should only manipulate its data source with
the following convenience functions:
Since 2.4 gtk_combo_box_entry_set_text_column ()void gtk_combo_box_entry_set_text_column (GtkComboBoxEntry *entry_box, gint text_column);
Sets the model column which
Since 2.4 gtk_combo_box_entry_get_text_column ()gint gtk_combo_box_entry_get_text_column (GtkComboBoxEntry *entry_box);
Returns the column which
Since 2.4 | ||||||||||||||||||||||||||||