Index: src/glade-signal-editor.c
===================================================================
RCS file: /cvs/gnome/glade3/src/glade-signal-editor.c,v
retrieving revision 1.29
diff -u -u -p -r1.29 glade-signal-editor.c
--- src/glade-signal-editor.c	7 Jun 2006 03:36:51 -0000	1.29
+++ src/glade-signal-editor.c	18 Aug 2006 20:52:06 -0000
@@ -408,7 +408,94 @@ glade_signal_editor_handler_cell_edited 
 	g_free (userdata);
 }
 
+static void
+glade_signal_editor_entry_set_completion (GladeSignalEditor *editor,
+					  GtkEntry *entry,
+					  const gchar *path)
+{
+	GtkTreeModel *model = GTK_TREE_MODEL (editor->model);
+	static GtkEntryCompletion *completion = NULL;
+	static GtkTreeModel *store_model;
+	static GtkListStore *store;
+	static GtkTreeIter iters[2];
+	gchar *handler, *signal, *name;
+	GtkTreeIter iter;
+	
+	if (completion == NULL)
+	{
+		gint i;
+		const gchar *handlers[] = {"gtk_widget_show", 
+					   "gtk_widget_hide",
+					   "gtk_widget_grab_focus",
+					   "gtk_widget_destroy",
+					   "gtk_true",
+					   "gtk_false",
+					   "gtk_main_quit",
+					   NULL};
+					   
+		store = gtk_list_store_new (1, G_TYPE_STRING);
+		store_model = GTK_TREE_MODEL (store);
+		
+		gtk_list_store_append (store, &iters[0]);
+		gtk_list_store_append (store, &iters[1]);
+		
+		for (i = 0; handlers[i]; i++)
+		{
+			gtk_list_store_append (store, &iter);
+			gtk_list_store_set (store, &iter, 0, handlers[i], -1);
+		}
+		
+		completion = gtk_entry_completion_new ();
+		gtk_entry_completion_set_text_column (completion, 0);
+		gtk_entry_completion_set_model (completion, store_model);
+	}
+	
+	name = (gchar *) glade_widget_get_name (editor->widget);
+		
+	if (gtk_tree_model_get_iter_from_string (model, &iter, path))
+	{
+		gtk_tree_model_get (model, &iter, COLUMN_SIGNAL, &signal, -1);
+		if (signal) glade_util_replace (signal, '-', '_');
+		else return;
+	}
+	else return;
+
+	handler = g_strdup_printf ("on_%s_%s", name, signal);
+	gtk_list_store_set (store, &iters[0], 0, handler, -1);
+	g_free (handler);
+
+	handler = g_strdup_printf ("%s_%s_cb", name, signal);
+	gtk_list_store_set (store, &iters[1], 0, handler, -1);
+	g_free (handler);
+	
+	g_free (signal);
 
+	gtk_entry_set_completion (entry, completion);
+}
+
+static void
+glade_signal_editor_handler_editing_started (GtkCellRenderer *cell,
+					     GtkCellEditable *editable,
+					     const gchar *path,
+					     GladeSignalEditor *editor)
+{
+	if (GTK_IS_ENTRY (editable))
+		glade_signal_editor_entry_set_completion (editor,
+							  GTK_ENTRY (editable),
+							  path);
+}
+
+static void
+glade_signal_editor_editing_started (GtkCellRenderer *cell,
+				     GtkCellEditable *editable,
+				     const gchar *path,
+				     gpointer user_data)
+{
+	GtkEntry *entry = (GTK_IS_ENTRY (editable)) ? GTK_ENTRY (editable) : NULL;
+
+	if (entry && is_void_signal_handler (gtk_entry_get_text (entry)))
+		gtk_entry_set_text (entry, "");	
+}
 
 static void
 glade_signal_editor_userdata_cell_edited (GtkCellRendererText *cell,
@@ -549,6 +636,12 @@ glade_signal_editor_construct_signals_li
 	g_signal_connect (renderer, "edited",
 			  G_CALLBACK (glade_signal_editor_handler_cell_edited), editor);
 
+	g_signal_connect (renderer, "editing-started",
+			  G_CALLBACK (glade_signal_editor_editing_started), NULL);
+
+	g_signal_connect (renderer, "editing-started",
+			  G_CALLBACK (glade_signal_editor_handler_editing_started), editor);
+
 	column = gtk_tree_view_column_new_with_attributes
 		(_("Handler"),     renderer,
 		 "text",           COLUMN_HANDLER,
@@ -566,6 +659,10 @@ glade_signal_editor_construct_signals_li
 
 	g_signal_connect (renderer, "edited",
 			  G_CALLBACK (glade_signal_editor_userdata_cell_edited), editor);
+	
+	g_signal_connect (renderer, "editing-started",
+			  G_CALLBACK (glade_signal_editor_editing_started), NULL);
+	
 	column = gtk_tree_view_column_new_with_attributes
 		(_("User data"), renderer,
 		 "text",           COLUMN_USERDATA,
