[evince/gtk-style-context: 3/8] libview: Use has-entry GtkComboBox instead of GtkComboBoxEntry



commit a2fcc3d7889f2caa1fa1b8ddae814d96f4939981
Author: Christian Persch <chpe gnome org>
Date:   Sun Oct 24 21:21:36 2010 +0200

    libview: Use has-entry GtkComboBox instead of GtkComboBoxEntry

 libview/ev-view.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 892b501..d6b949a 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2221,14 +2221,14 @@ ev_view_form_field_choice_changed (GtkWidget   *widget,
 			field->changed = TRUE;
 		}
 
-		if (GTK_IS_COMBO_BOX_ENTRY (widget)) {
-			gchar *text;
-			
-			text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
+		if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget))) {
+			const gchar *text;
+
+			text = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))));
 			if (!field_choice->text ||
 			    (field_choice->text && g_ascii_strcasecmp (field_choice->text, text) != 0)) {
 				g_free (field_choice->text);
-				field_choice->text = text;
+				field_choice->text = g_strdup (text);
 				field->changed = TRUE;
 			}
 		}
@@ -2335,8 +2335,10 @@ ev_view_form_field_choice_create_widget (EvView      *view,
 					view);
 	} else if (field_choice->is_editable) { /* ComboBoxEntry */
 		gchar *text;
-		
-		choice = gtk_combo_box_entry_new_with_model (model, 0);
+
+                /* FIXME once gtk bug 633050 is fixed */
+                choice = g_object_new (GTK_TYPE_COMBO_BOX, "has-entry", TRUE, "model", model, NULL);
+
 		text = ev_document_forms_form_field_choice_get_text (EV_DOCUMENT_FORMS (view->document), field);
 		if (text) {
 			gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (choice))), text);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]