forked from AuroraMiddleware/gtk
gtk3-demo: Adapt to GtkSearchEntry api changes
Connect to ::search-changed instead of ::changed.
This commit is contained in:
parent
398f9e8b5b
commit
d1a91671e4
@ -26,6 +26,14 @@ search_changed_cb (GtkSearchEntry *entry,
|
|||||||
gtk_label_set_text (result_label, text ? text : "");
|
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
|
static gboolean
|
||||||
window_key_press_event_cb (GtkWidget *widget,
|
window_key_press_event_cb (GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
@ -96,8 +104,10 @@ do_search_entry2 (GtkWidget *do_widget)
|
|||||||
label = gtk_label_new ("");
|
label = gtk_label_new ("");
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
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_CALLBACK (search_changed_cb), label);
|
||||||
|
g_signal_connect (entry, "changed",
|
||||||
|
G_CALLBACK (changed_cb), label);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
|
Loading…
Reference in New Issue
Block a user