[gtk+] gtk3-demo: Adapt to GtkSearchEntry api changes



commit d1a91671e4f9134556287590dfcb4e498b39996b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 28 21:51:45 2013 -0400

    gtk3-demo: Adapt to GtkSearchEntry api changes
    
    Connect to ::search-changed instead of ::changed.

 demos/gtk-demo/search_entry2.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/search_entry2.c b/demos/gtk-demo/search_entry2.c
index a53c82f..839d4d5 100644
--- a/demos/gtk-demo/search_entry2.c
+++ b/demos/gtk-demo/search_entry2.c
@@ -26,6 +26,14 @@ search_changed_cb (GtkSearchEntry *entry,
   gtk_label_set_text (result_label, text ? text : "");
 }
 
+static void
+changed_cb (GtkEditable *editable)
+{
+  const char *text;
+  text = gtk_entry_get_text (GTK_ENTRY (editable));
+  g_message ("changed: %s", text);
+}
+
 static gboolean
 window_key_press_event_cb (GtkWidget    *widget,
                           GdkEvent     *event,
@@ -96,8 +104,10 @@ do_search_entry2 (GtkWidget *do_widget)
       label = gtk_label_new ("");
       gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
 
-      g_signal_connect (entry, "changed",
+      g_signal_connect (entry, "search-changed",
                         G_CALLBACK (search_changed_cb), label);
+      g_signal_connect (entry, "changed",
+                        G_CALLBACK (changed_cb), label);
     }
 
   if (!gtk_widget_get_visible (window))


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