[Telepathy] [PATCH 1/9] Chooser: Use gtk_entry_completion to complete in-combo options

Niv Sardi xaiki at debian.org
Mon Jun 8 13:31:36 PDT 2009


This Sets up really simple completion, no icons, and really, no action,
more comes with the next patches

Signed-off-by: Niv Sardi <xaiki at debian.org>
---
 libempathy-gtk/empathy-presence-chooser.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index 17b39c0..16e364c 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -155,6 +155,8 @@ static void
 presence_chooser_create_model (EmpathyPresenceChooser *self)
 {
 	GtkListStore *store;
+	GtkEntryCompletion *completion;
+	GtkWidget *entry;
 	char *custom_message;
 	int i;
 
@@ -229,6 +231,14 @@ presence_chooser_create_model (EmpathyPresenceChooser *self)
 	g_free (custom_message);
 
 	gtk_combo_box_set_model (GTK_COMBO_BOX (self), GTK_TREE_MODEL (store));
+
+        entry = gtk_bin_get_child (GTK_BIN (self));
+        completion = gtk_entry_completion_new ();
+        gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (store));
+	gtk_entry_completion_set_text_column (completion, COL_STATUS_TEXT);
+	gtk_entry_completion_set_inline_completion(completion, TRUE);
+        gtk_entry_set_completion (GTK_ENTRY (entry), completion);
+
 	g_object_unref (store);
 }
 
-- 
1.6.3.1



More information about the telepathy mailing list