diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-05-10 17:55:49 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-05-10 17:55:49 +0000 |
commit | d5136747a4c395565e7ed8efd162e03dec75d3e6 (patch) | |
tree | dffe21d164abe258b322b06127c408c1db54db78 | |
parent | b30131570649568c520f826436bbe1790162c0fe (diff) | |
download | gtk+-d5136747a4c395565e7ed8efd162e03dec75d3e6.tar.gz |
Make the second example use the ::match-selected signal to make it
2004-05-10 Matthias Clasen <mclasen@redhat.com>
* tests/testentrycompletion.c: Make the second example use the
::match-selected signal to make it actually work.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 3 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 3 | ||||
-rw-r--r-- | tests/testentrycompletion.c | 19 |
5 files changed, 31 insertions, 0 deletions
@@ -1,5 +1,8 @@ 2004-05-10 Matthias Clasen <mclasen@redhat.com> + * tests/testentrycompletion.c: Make the second example use the + ::match-selected signal to make it actually work. + * gtk/gtkentrycompletion.c (gtk_entry_completion_init): * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection mode. (#127648, Dave Bordoley) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 36d2a56cc7..76f24eeba9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-05-10 Matthias Clasen <mclasen@redhat.com> + * tests/testentrycompletion.c: Make the second example use the + ::match-selected signal to make it actually work. + * gtk/gtkentrycompletion.c (gtk_entry_completion_init): * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection mode. (#127648, Dave Bordoley) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 36d2a56cc7..76f24eeba9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-05-10 Matthias Clasen <mclasen@redhat.com> + * tests/testentrycompletion.c: Make the second example use the + ::match-selected signal to make it actually work. + * gtk/gtkentrycompletion.c (gtk_entry_completion_init): * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection mode. (#127648, Dave Bordoley) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 36d2a56cc7..76f24eeba9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-05-10 Matthias Clasen <mclasen@redhat.com> + * tests/testentrycompletion.c: Make the second example use the + ::match-selected signal to make it actually work. + * gtk/gtkentrycompletion.c (gtk_entry_completion_init): * gtk/gtkcombobox.c (gtk_combo_box_list_setup): Use hover selection mode. (#127648, Dave Bordoley) diff --git a/tests/testentrycompletion.c b/tests/testentrycompletion.c index c894b90413..e4b7ef2b78 100644 --- a/tests/testentrycompletion.c +++ b/tests/testentrycompletion.c @@ -221,6 +221,23 @@ animation_timer (GtkEntryCompletion *completion) return TRUE; } +gboolean +match_selected_cb (GtkEntryCompletion *completion, + GtkTreeModel *model, + GtkTreeIter *iter) +{ + gchar *str; + GtkWidget *entry; + + entry = gtk_entry_completion_get_entry (completion); + gtk_tree_model_get (GTK_TREE_MODEL (model), iter, 1, &str, -1); + gtk_entry_set_text (GTK_ENTRY (entry), str); + gtk_editable_set_position (GTK_EDITABLE (entry), -1); + g_free (str); + + return TRUE; +} + int main (int argc, char *argv[]) { @@ -295,6 +312,8 @@ main (int argc, char *argv[]) "text", 1, NULL); gtk_entry_completion_set_match_func (completion, match_func, NULL, NULL); + g_signal_connect (G_OBJECT (completion), "match-selected", + G_CALLBACK (match_selected_cb), NULL); gtk_entry_completion_insert_action_text (completion, 100, "action!"); gtk_entry_completion_insert_action_text (completion, 101, "'nother action!"); |