+static void
+psppire_value_entry_text_changed (GtkEntryBuffer *buffer,
+ GParamSpec *pspec,
+ PsppireValueEntry *obj)
+{
+ obj->cur_value = NULL;
+}
+
+static void
+on_entry_activate (GtkWidget *w)
+{
+ PsppireValueEntry *ve = PSPPIRE_VALUE_ENTRY (w);
+ g_signal_emit (w, signals [EDIT_DONE], 0);
+}
+
+static void
+on_realize (GtkWidget *w)
+{
+ GtkEntry *entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (w)));
+ GtkEntryBuffer *buffer = gtk_entry_get_buffer (entry);
+
+ gtk_combo_box_set_entry_text_column (GTK_COMBO_BOX (w), COL_LABEL);
+
+ g_signal_connect (buffer, "notify::text",
+ G_CALLBACK (psppire_value_entry_text_changed), w);
+
+ g_signal_connect_swapped (entry, "activate",
+ G_CALLBACK (on_entry_activate), w);
+
+ gtk_widget_set_can_focus (GTK_WIDGET (entry), TRUE);
+
+ GTK_WIDGET_CLASS (psppire_value_entry_parent_class)->realize (w);
+}
+
+
+/*
+ The "has-entry" property for the parent class (GTK_COMBO_BOX) is
+ a) Construct-only ; and b) defaults to FALSE.
+ We want it to default to TRUE. So we override it here.
+*/
+static GObject*
+my_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties)
+{
+ GObject *o =
+ G_OBJECT_CLASS (psppire_value_entry_parent_class)->constructor
+ (type, n_construct_properties, construct_properties);
+
+ g_object_set (o, "has-entry", TRUE, NULL);
+
+ return o;
+}
+