glade3 r2039 - in trunk: . gladeui plugins/gtk+



Author: tvb
Date: Sat Nov 22 18:35:11 2008
New Revision: 2039
URL: http://svn.gnome.org/viewvc/glade3?rev=2039&view=rev

Log:

	* gladeui/glade-base-editor.c: 
	  - Removed apis to add popups, now they are autogenerated
	  - Added glade_base_editor_append_types(), glade_base_editor_new() now
	    only adds types supported by the container object, use _append_types() to
	    define hierarcic type relations for children.

	* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Now the toolbar editor
	  can add menus and edit menus inside the gtkmenutoolbutton (fixed bug 429438).



Modified:
   trunk/ChangeLog
   trunk/gladeui/glade-base-editor.c
   trunk/gladeui/glade-base-editor.h
   trunk/plugins/gtk+/glade-gtk.c
   trunk/plugins/gtk+/gtk+.xml.in

Modified: trunk/gladeui/glade-base-editor.c
==============================================================================
--- trunk/gladeui/glade-base-editor.c	(original)
+++ trunk/gladeui/glade-base-editor.c	Sat Nov 22 18:35:11 2008
@@ -43,31 +43,36 @@
 typedef enum
 {
 	GLADE_BASE_EDITOR_GTYPE,
-	GLADE_BASE_EDITOR_NAME,
-	GLADE_BASE_EDITOR_N_COLUMNS
+	GLADE_BASE_EDITOR_CLASS_NAME,
+	GLADE_BASE_EDITOR_TYPES_N_COLUMNS
 }GladeBaseEditorChildEnum;
 
 typedef enum
 {
-	GLADE_BASE_EDITOR_MENU_GWIDGET,
-	GLADE_BASE_EDITOR_MENU_OBJECT,
-	GLADE_BASE_EDITOR_MENU_TYPE_NAME,
-	GLADE_BASE_EDITOR_MENU_NAME,
-	GLADE_BASE_EDITOR_MENU_N_COLUMNS
+	GLADE_BASE_EDITOR_GWIDGET,
+	GLADE_BASE_EDITOR_OBJECT,
+	GLADE_BASE_EDITOR_TYPE_NAME,
+	GLADE_BASE_EDITOR_NAME,
+	GLADE_BASE_EDITOR_CHILD_TYPES,
+	GLADE_BASE_EDITOR_N_COLUMNS
 }GladeBaseEditorEnum;
 
+typedef struct {
+	GType         parent_type;
+	GtkTreeModel *children;
+} ChildTypeTab;
+
 struct _GladeBaseEditorPrivate
 {
 	GladeWidget *gcontainer; /* The container we are editing */
-	GtkListStore *children;
 	
 	/* Editor UI */
-	GtkWidget *paned, *popup, *table, *treeview;
+	GtkWidget *paned, *table, *treeview;
 	GtkWidget *remove_button, *signal_editor_w;
 	GladeSignalEditor *signal_editor;
+
+	GList *child_types;
 	
-	GtkListStore *lstore;
-	GtkTreeStore *tstore;
 	GtkTreeModel *model;
 	GladeProject *project;
 	
@@ -108,65 +113,59 @@
 static void glade_base_editor_block_callbacks (GladeBaseEditor *editor,
 					       gboolean block);
 
-/* glade_base_editor_store_*  wrapper functions to use the tree/list store */
-static void
-glade_base_editor_store_set (GladeBaseEditor *editor, GtkTreeIter *iter, ...)
+static gint
+sort_type_by_hierarchy (ChildTypeTab *a, ChildTypeTab *b)
 {
-	va_list args;
+	if (g_type_is_a (a->parent_type, b->parent_type))
+		return -1;
 	
-	va_start (args, iter);
-	
-	if (editor->priv->tstore)
-		gtk_tree_store_set_valist (editor->priv->tstore, iter, args);
-	else
-		gtk_list_store_set_valist (editor->priv->lstore, iter, args);
-		
-	va_end (args);
+	return 1;
 }
 
-static void
-glade_base_editor_store_remove (GladeBaseEditor *editor, GtkTreeIter *iter)
+static GtkTreeModel *
+get_children_model_for_type (GladeBaseEditor *editor, GType type)
 {
-	if (editor->priv->tstore)
-		gtk_tree_store_remove (editor->priv->tstore, iter);
-	else
-		gtk_list_store_remove (editor->priv->lstore, iter);
+	GList *l;
+	for (l = editor->priv->child_types; l; l = l->next)
+	{
+		ChildTypeTab *tab = l->data;
+		if (g_type_is_a (type, tab->parent_type))
+			return tab->children;
+	}
+	return NULL;
 }
 
-static void
-glade_base_editor_store_clear (GladeBaseEditor *editor)
+static GtkTreeModel *
+get_children_model_for_child_type (GladeBaseEditor *editor, GType type)
 {
-	gtk_tree_view_set_model (GTK_TREE_VIEW (editor->priv->treeview), NULL);
-	
-	if (editor->priv->tstore)
-		gtk_tree_store_clear (editor->priv->tstore);
-	else
-		gtk_list_store_clear (editor->priv->lstore);
-	
-	gtk_tree_view_set_model (GTK_TREE_VIEW (editor->priv->treeview), editor->priv->model);
-}
+	GList *l;
+	GtkTreeModel *model = NULL;
 
-static void
-glade_base_editor_store_append (GladeBaseEditor *editor,
-				GtkTreeIter *iter,
-				GtkTreeIter *parent)
-{
-	if (editor->priv->tstore)
-		gtk_tree_store_append (editor->priv->tstore, iter, parent);
-	else
-		gtk_list_store_append (editor->priv->lstore, iter);
-}
+	/* Get deep derived classes first and work up the sorted heirarchy */
+	for (l = g_list_last (editor->priv->child_types); model == NULL && l; l = l->prev)
+	{
+		ChildTypeTab *tab = l->data;
+		GtkTreeIter   iter;
+		GType         iter_type;
 
-static void
-glade_base_editor_store_insert_after (GladeBaseEditor *editor,
-				      GtkTreeIter *iter,
-				      GtkTreeIter *parent,
-				      GtkTreeIter *sibling)
-{
-	if (editor->priv->tstore)
-		gtk_tree_store_insert_after (editor->priv->tstore, iter, parent, sibling);
-	else
-		gtk_list_store_insert_after (editor->priv->lstore, iter, sibling);
+		if (!gtk_tree_model_get_iter_first (tab->children, &iter))
+			continue;
+
+		do 
+		{
+			gtk_tree_model_get (tab->children, &iter,
+					    GLADE_BASE_EDITOR_GTYPE, &iter_type,
+					    -1);	
+
+			/* Find exact match types in this case */
+			if (iter_type == type)
+				model = tab->children;
+
+		} while (model == NULL &&
+			 gtk_tree_model_iter_next (tab->children, &iter));
+	}
+
+	return model;
 }
 
 static gboolean
@@ -175,11 +174,13 @@
 				 GType child_type,
 				 ...)
 {
-	GtkTreeModel *model = GTK_TREE_MODEL (e->priv->children);
+	GtkTreeModel *model;
 	GtkTreeIter iter;
 	GType type;
 	
-	if (gtk_tree_model_get_iter_first (model, &iter) == FALSE)
+	model = get_children_model_for_child_type (e, child_type);
+
+	if (!model || gtk_tree_model_get_iter_first (model, &iter) == FALSE)
 		return FALSE;
 	
 	do
@@ -187,6 +188,7 @@
 		gtk_tree_model_get (model, &iter,
 				    GLADE_BASE_EDITOR_GTYPE, &type,
 				    -1);
+
 		if (child_type == type)
 		{
 			va_list args;
@@ -201,6 +203,7 @@
 	return FALSE;
 }
 
+
 static gchar *
 glade_base_editor_get_display_name (GladeBaseEditor *editor,
 				    GladeWidget *gchild)
@@ -219,49 +222,57 @@
 {
 	GtkWidget *widget = GTK_WIDGET (glade_widget_get_object (gwidget));
 	GList *children, *l;
+	GladeWidget *gparent = NULL;
 	GtkTreeIter iter;
+
+	if (parent)
+		gtk_tree_model_get (e->priv->model, parent,
+				    GLADE_BASE_EDITOR_GWIDGET, &gparent,
+				    -1);
+
 	
-	children = l = glade_widget_adaptor_get_children (gwidget->adaptor,
-							  G_OBJECT (widget));
+	children = glade_widget_adaptor_get_children (gwidget->adaptor,
+						      G_OBJECT (widget));
 	
-	while (l)
+	for (l = children; l; l = l->next)
 	{
 		GObject *child = (GObject*)l->data;
 		GladeWidget *gchild;
 		
-		if(child && (gchild = glade_widget_get_from_gobject (child)))
+		if (child && (gchild = glade_widget_get_from_gobject (child)))
 		{
-			gchar *type_name, *name;
+			gchar *type_name = NULL, *name;
 						
+
+			/* Have to check parents here for compatibility (could be the parenting menuitem of this menu
+			 * supports a menuitem...) */
 			if (glade_base_editor_get_type_info (e, NULL,
 							     G_OBJECT_TYPE (child),
-							     GLADE_BASE_EDITOR_NAME, &type_name,
+							     GLADE_BASE_EDITOR_CLASS_NAME, &type_name,
 							     -1))
 			{
-				glade_base_editor_store_append (e, &iter, parent);
+				gtk_tree_store_append (GTK_TREE_STORE (e->priv->model), &iter, parent);
 				
 				name = glade_base_editor_get_display_name (e, gchild);
 				
-				glade_base_editor_store_set (e, &iter,
-						    GLADE_BASE_EDITOR_MENU_GWIDGET, gchild,
-						    GLADE_BASE_EDITOR_MENU_OBJECT, child,
-						    GLADE_BASE_EDITOR_MENU_TYPE_NAME, type_name,
-						    GLADE_BASE_EDITOR_MENU_NAME, name,
+				gtk_tree_store_set (GTK_TREE_STORE (e->priv->model), &iter,
+						    GLADE_BASE_EDITOR_GWIDGET, gchild,
+						    GLADE_BASE_EDITOR_OBJECT, child,
+						    GLADE_BASE_EDITOR_TYPE_NAME, type_name,
+						    GLADE_BASE_EDITOR_NAME, name,
+						    GLADE_BASE_EDITOR_CHILD_TYPES, 
+						    get_children_model_for_type (e, G_OBJECT_TYPE (gwidget->object)),
 						    -1);
-				
-				if (GTK_IS_CONTAINER (child))
-					glade_base_editor_fill_store_real (e, gchild, &iter);
+
+				glade_base_editor_fill_store_real (e, gchild, &iter);
 			
 				g_free (name);
 				g_free (type_name);
 			}
 			else
-				if (GTK_IS_CONTAINER (child))
-					glade_base_editor_fill_store_real (e, gchild, parent);
+				glade_base_editor_fill_store_real (e, gchild, parent);
 
 		}
-
-		l = g_list_next (l);
 	}
 	
 	g_list_free (children);
@@ -270,10 +281,13 @@
 static void
 glade_base_editor_fill_store (GladeBaseEditor *e)
 {
-	glade_base_editor_store_clear (e);
+	gtk_tree_store_clear (GTK_TREE_STORE (e->priv->model));
 	gtk_tree_view_set_model (GTK_TREE_VIEW (e->priv->treeview), NULL);
 	glade_base_editor_fill_store_real (e, e->priv->gcontainer, NULL);
 	gtk_tree_view_set_model (GTK_TREE_VIEW (e->priv->treeview), e->priv->model);
+
+	gtk_tree_view_expand_all (GTK_TREE_VIEW (e->priv->treeview));
+
 }
 
 static gboolean
@@ -361,8 +375,8 @@
 	gtk_widget_set_sensitive (e->remove_button, TRUE);
 	
 	gtk_tree_model_get (e->model, &iter,
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, &gchild,
-			    GLADE_BASE_EDITOR_MENU_OBJECT, &child,
+			    GLADE_BASE_EDITOR_GWIDGET, &gchild,
+			    GLADE_BASE_EDITOR_OBJECT, &child,
 			    -1);
 
 	/* Emit child-selected signal and let the user add the properties */
@@ -383,7 +397,7 @@
 	return FALSE;
 }
 
-
+/* XXX Can we make it crisper by removing this idle ?? */
 static void 
 glade_base_editor_update_properties (GladeBaseEditor *editor)
 {
@@ -422,7 +436,7 @@
 	
 	do
 	{
-		gtk_tree_model_get (model, iter, GLADE_BASE_EDITOR_MENU_GWIDGET, &child, -1);
+		gtk_tree_model_get (model, iter, GLADE_BASE_EDITOR_GWIDGET, &child, -1);
 	
 		if (child == gchild) return TRUE;
 
@@ -464,7 +478,7 @@
 				     GtkTreeIter *iter,
 				     GType type)
 {
-	GladeWidget *gchild;
+	GladeWidget *gchild, *gparent;
 	GObject *child;
 	gchar *class_name;
 	gboolean retval;
@@ -473,16 +487,22 @@
 	
 	/* Get old widget data */
 	gtk_tree_model_get (editor->priv->model, iter,
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, &gchild,
-			    GLADE_BASE_EDITOR_MENU_OBJECT, &child,
+			    GLADE_BASE_EDITOR_GWIDGET, &gchild,
+			    GLADE_BASE_EDITOR_OBJECT, &child,
 			    -1);
 	
 	if (type == G_OBJECT_TYPE (child)) return;
+
+	if (!gchild || !gchild->parent)
+		return;
+
+	gparent = gchild->parent;
 	
 	/* Start of glade-command */
 		
-	if (glade_base_editor_get_type_info (editor, NULL, type,
-					     GLADE_BASE_EDITOR_NAME, &class_name,
+	if (glade_base_editor_get_type_info (editor, NULL, 
+					     type,
+					     GLADE_BASE_EDITOR_CLASS_NAME, &class_name,
 					     -1))
 	{
 		glade_command_push_group (_("Setting object type on %s to %s"),
@@ -511,7 +531,7 @@
 	GtkTreeIter iter, combo_iter;
 	GType type;
 	
-	if (! glade_base_editor_get_child_selected (e, &iter))
+	if (!glade_base_editor_get_child_selected (e, &iter))
 		return;
 	
 	gtk_combo_box_get_active_iter (widget, &combo_iter);
@@ -529,7 +549,7 @@
 				     GladeBaseEditor *editor)
 {
 	GladeBaseEditorPrivate *e = editor->priv;
-	GtkTreeModel *child_class = GTK_TREE_MODEL (e->children);
+	GtkTreeModel *child_class;
 	GtkTreePath *path;
 	GtkTreeIter iter, combo_iter;
 	GType type;
@@ -538,21 +558,25 @@
 	path = gtk_tree_path_new_from_string (path_string);
 	gtk_tree_model_get_iter (e->model, &iter, path);
 	gtk_tree_model_get (e->model, &iter,
-			    GLADE_BASE_EDITOR_MENU_TYPE_NAME, &type_name,
+			    GLADE_BASE_EDITOR_CLASS_NAME, &type_name,
+			    GLADE_BASE_EDITOR_CHILD_TYPES, &child_class,
 			    -1);
+
 	if (strcmp (type_name, new_text) == 0)
 	{
 		g_free (type_name);
 		return;
 	}
 	
-	/* Lookup GladeWidgetClass */
-	gtk_tree_model_get_iter_first (child_class, &combo_iter);
+	/* Lookup GType */
+	if (!gtk_tree_model_get_iter_first (child_class, &combo_iter))
+		return;
+
 	do
 	{
 		gtk_tree_model_get (child_class, &combo_iter,
 				    GLADE_BASE_EDITOR_GTYPE, &type,
-				    GLADE_BASE_EDITOR_NAME, &type_name,
+				    GLADE_BASE_EDITOR_CLASS_NAME, &type_name,
 				    -1);
 		
 		if (strcmp (type_name, new_text) == 0) break;
@@ -563,30 +587,6 @@
 	glade_base_editor_child_change_type (editor, &iter, type);
 }
 
-static gint
-glade_base_editor_popup_handler (GtkWidget *treeview,
-				 GdkEventButton *event,
-				 GladeBaseEditor *e)
-{
-	GtkTreePath *path;
-
-	if (event->button == 3)
-	{
-		if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview),
-			(gint) event->x, (gint) event->y, &path, NULL, NULL, NULL))
-		{
-			gtk_tree_view_set_cursor (GTK_TREE_VIEW (treeview), path, NULL, FALSE);
-			gtk_tree_path_free (path);
-		}
-		
-		gtk_menu_popup (GTK_MENU (e->priv->popup), NULL, NULL, NULL, NULL, 
-				event->button, event->time);
-		return TRUE;
-	}
-
-	return FALSE;
-}
-
 static void
 glade_base_editor_reorder_children (GladeBaseEditor *editor, GtkTreeIter *child)
 {
@@ -603,7 +603,7 @@
 
 	do
 	{
-		gtk_tree_model_get (model, &iter, GLADE_BASE_EDITOR_MENU_GWIDGET, &gchild, -1);
+		gtk_tree_model_get (model, &iter, GLADE_BASE_EDITOR_GWIDGET, &gchild, -1);
 		
 		if ((property = glade_widget_get_property (gchild, "position")) != NULL)
 			glade_command_set_property (property, position);
@@ -618,41 +618,36 @@
 {
 	GladeBaseEditorPrivate *e = editor->priv;
 	GtkTreeIter iter, new_iter;
-	GladeWidget *gparent, *gchild = NULL, *gchild_new;
-	gchar *type_name, *name, *class_name;
-
-	if (glade_base_editor_get_type_info (editor, NULL, type,
-					     GLADE_BASE_EDITOR_NAME, &class_name,
-					     -1) == FALSE) return;
+	GladeWidget *gparent, *gchild_new;
+	gchar *name, *class_name;
+	gboolean selected_iter;
 	
 	glade_base_editor_block_callbacks (editor, TRUE);
 	
 	gparent = e->gcontainer;
 
-	if (glade_base_editor_get_child_selected (editor, &iter))
+	if ((selected_iter = glade_base_editor_get_child_selected (editor, &iter)))
 	{
-		gtk_tree_model_get (e->model, &iter,
-				    GLADE_BASE_EDITOR_MENU_GWIDGET, &gchild,
-				    -1);
+
 		if (as_child)
+			gtk_tree_model_get (e->model, &iter,
+					    GLADE_BASE_EDITOR_GWIDGET, &gparent,
+					    -1);
+		else if (gtk_tree_model_iter_parent (e->model, &new_iter, &iter))
 		{
-			glade_base_editor_store_append (editor, &new_iter, &iter);
-			gparent = gchild;
-		}
-		else
-		{
-			glade_base_editor_store_insert_after (editor, &new_iter,
-							      NULL, &iter);
-			gparent = glade_widget_get_parent (gchild);
+			gtk_tree_model_get (e->model, &new_iter,
+					    GLADE_BASE_EDITOR_GWIDGET, &gparent,
+					    -1);
 		}
-		
 	}
-	else
-		glade_base_editor_store_append (editor, &new_iter, NULL);
+
+	if (!glade_base_editor_get_type_info (editor, NULL, type,
+					      GLADE_BASE_EDITOR_CLASS_NAME, &class_name,
+					      -1)) 
+		return;
 
 	glade_command_push_group (_("Add a %s to %s"), class_name, 
 				  glade_widget_get_name (gparent));
-	g_free (class_name);
 	
 	/* Build Child */
 	g_signal_emit (editor, glade_base_editor_signals[SIGNAL_BUILD_CHILD],
@@ -661,21 +656,29 @@
 	if (gchild_new == NULL)
 	{
 		glade_command_pop_group ();
-		glade_base_editor_store_remove (editor, &new_iter);
 		return;
 	}
-	
-	glade_base_editor_get_type_info (editor, NULL, type,
-					 GLADE_BASE_EDITOR_NAME, &type_name,
-					 -1);
+
+	if (selected_iter)
+	{
+		if (as_child)
+			gtk_tree_store_append (GTK_TREE_STORE (editor->priv->model), &new_iter, &iter);
+		else
+			gtk_tree_store_insert_after (GTK_TREE_STORE (editor->priv->model), &new_iter,
+						     NULL, &iter);
+	}
+	else
+		gtk_tree_store_append (GTK_TREE_STORE (editor->priv->model), &new_iter, NULL);
 	
 	name = glade_base_editor_get_display_name (editor, gchild_new);
 	
-	glade_base_editor_store_set (editor, &new_iter, 
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, gchild_new,
-			    GLADE_BASE_EDITOR_MENU_OBJECT, glade_widget_get_object (gchild_new),
-			    GLADE_BASE_EDITOR_MENU_TYPE_NAME, type_name,
-			    GLADE_BASE_EDITOR_MENU_NAME, name,
+	gtk_tree_store_set (GTK_TREE_STORE (editor->priv->model), &new_iter, 
+			    GLADE_BASE_EDITOR_GWIDGET, gchild_new,
+			    GLADE_BASE_EDITOR_OBJECT, glade_widget_get_object (gchild_new),
+			    GLADE_BASE_EDITOR_TYPE_NAME, class_name,
+			    GLADE_BASE_EDITOR_NAME, name,
+			    GLADE_BASE_EDITOR_CHILD_TYPES, 
+			    get_children_model_for_type (editor, G_OBJECT_TYPE (gparent->object)),
 			    -1);
 
 	glade_base_editor_reorder_children (editor, &new_iter);
@@ -688,9 +691,10 @@
 	glade_base_editor_block_callbacks (editor, FALSE);
 	
 	g_free (name);
-	g_free (type_name);
+	g_free (class_name);
 }
 
+
 static void
 glade_base_editor_add_item_activate (GtkMenuItem *menuitem, GladeBaseEditor *e)
 {
@@ -701,6 +705,123 @@
 	glade_base_editor_add_child (e, type, as_child);
 }
 
+static GtkWidget *
+glade_base_editor_popup (GladeBaseEditor *editor,
+			 GladeWidget     *widget)
+{
+	GtkWidget    *popup, *item;
+	GtkTreeModel *model;
+	GtkTreeIter   iter;
+	GType         iter_type;
+	gchar        *label;
+	gchar        *class_name;
+
+
+	if ((model = get_children_model_for_child_type (editor, G_OBJECT_TYPE (widget->object))) == NULL)
+		return NULL;
+
+	popup = gtk_menu_new ();
+
+
+	if (gtk_tree_model_get_iter_first (model, &iter))
+		do
+		{
+			gtk_tree_model_get (model, &iter,
+					    GLADE_BASE_EDITOR_GTYPE, &iter_type,
+					    GLADE_BASE_EDITOR_CLASS_NAME, &class_name,
+					    -1);
+			
+			label = g_strdup_printf (_("Add %s item"), class_name);
+
+			item = gtk_menu_item_new_with_label (label);
+			gtk_widget_show (item);
+			
+			g_object_set_data (G_OBJECT (item), "object_type",
+					   GINT_TO_POINTER (iter_type));
+			
+			g_object_set_data (G_OBJECT (item), "object_as_child",
+					   GINT_TO_POINTER (FALSE));
+
+			g_signal_connect (item, "activate", 
+					  G_CALLBACK (glade_base_editor_add_item_activate), editor);
+			gtk_menu_shell_append (GTK_MENU_SHELL (popup), item);
+			
+			g_free (label);
+			g_free (class_name);
+
+		} while (gtk_tree_model_iter_next (model, &iter));
+
+
+	if ((model = get_children_model_for_type (editor, G_OBJECT_TYPE (widget->object))) &&
+	    gtk_tree_model_get_iter_first (model, &iter))
+		do
+		{
+			gtk_tree_model_get (model, &iter,
+					    GLADE_BASE_EDITOR_GTYPE, &iter_type,
+					    GLADE_BASE_EDITOR_CLASS_NAME, &class_name,
+					    -1);
+			
+			label = g_strdup_printf (_("Add child %s item"), class_name);
+
+			item = gtk_menu_item_new_with_label (label);
+			gtk_widget_show (item);
+			
+			g_object_set_data (G_OBJECT (item), "object_type",
+					   GINT_TO_POINTER (iter_type));
+			
+			g_object_set_data (G_OBJECT (item), "object_as_child",
+					   GINT_TO_POINTER (TRUE));
+
+			g_signal_connect (item, "activate", 
+					  G_CALLBACK (glade_base_editor_add_item_activate), editor);
+			gtk_menu_shell_append (GTK_MENU_SHELL (popup), item);
+			
+			g_free (label);
+			g_free (class_name);
+
+		} while (gtk_tree_model_iter_next (model, &iter));
+
+	return popup;
+}
+
+static gint
+glade_base_editor_popup_handler (GtkWidget *treeview,
+				 GdkEventButton *event,
+				 GladeBaseEditor *e)
+{
+	GtkTreePath *path;
+	GtkWidget *popup;
+
+	if (event->button == 3)
+	{
+		if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview),
+			(gint) event->x, (gint) event->y, &path, NULL, NULL, NULL))
+		{
+			GtkTreeIter iter;
+			GladeWidget *gwidget;
+
+			gtk_tree_view_set_cursor (GTK_TREE_VIEW (treeview), path, NULL, FALSE);
+
+			gtk_tree_model_get_iter (e->priv->model, &iter, path);
+			gtk_tree_model_get (e->priv->model, &iter,
+					    GLADE_BASE_EDITOR_GWIDGET, &gwidget,
+					    -1);
+
+			
+			popup = glade_base_editor_popup (e, gwidget);
+
+			gtk_tree_path_free (path);
+
+			gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, 
+					event->button, event->time);
+		}
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+
 static void
 glade_base_editor_add_activate (GtkButton *button,  GladeBaseEditor *e)
 {
@@ -718,11 +839,11 @@
 	if (!glade_base_editor_get_child_selected (e, &iter)) return;
 
 	gtk_tree_model_get (e->priv->model, &iter,
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, &child, -1);
+			    GLADE_BASE_EDITOR_GWIDGET, &child, -1);
 		
 	if (gtk_tree_model_iter_parent (e->priv->model, &parent, &iter))
 		gtk_tree_model_get (e->priv->model, &parent,
-				    GLADE_BASE_EDITOR_MENU_GWIDGET, &gparent,
+				    GLADE_BASE_EDITOR_GWIDGET, &gparent,
 				    -1);
 	else
 		gparent = e->priv->gcontainer;
@@ -761,26 +882,29 @@
 			    GladeWidget *gchild,
 			    gboolean valid_type)
 {
-	GladeWidget *gcontainer;
+	GladeWidget *gcontainer = gchild->parent;
+
+	if (!gcontainer)
+		return FALSE;
 	
 	if (valid_type)
 	{
 		GObject *child = glade_widget_get_object (gchild);
-		
-		gcontainer = e->priv->gcontainer;
-		
+				
 		if (gchild->internal ||
 		    glade_base_editor_get_type_info (e, NULL,
 						     G_OBJECT_TYPE (child),
 						     -1) == FALSE)
 			return FALSE;
+
+		gcontainer = e->priv->gcontainer;
 	}
 	else
 	{
 		GtkTreeIter iter;
 		if (glade_base_editor_get_child_selected (e, &iter))
 			gtk_tree_model_get (e->priv->model, &iter,
-					    GLADE_BASE_EDITOR_MENU_GWIDGET, &gcontainer,
+					    GLADE_BASE_EDITOR_GWIDGET, &gcontainer,
 					    -1);
 		else
 			return FALSE;
@@ -829,7 +953,7 @@
 	if (glade_base_editor_get_child_selected (editor, &iter))
 	{
 		gtk_tree_model_get (editor->priv->model, &iter,
-				    GLADE_BASE_EDITOR_MENU_GWIDGET, &selected_child,
+				    GLADE_BASE_EDITOR_GWIDGET, &selected_child,
 				    -1);
 		if (widget == selected_child)
 			glade_base_editor_update_properties (editor);
@@ -854,11 +978,11 @@
 				  glade_widget_get_name (e->gcontainer));
 	
 	gtk_tree_model_get (e->model, iter,
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, &gchild, -1);
+			    GLADE_BASE_EDITOR_GWIDGET, &gchild, -1);
 	
 	if (gtk_tree_model_iter_parent (e->model, &parent_iter, iter))
 		gtk_tree_model_get (e->model, &parent_iter,
-				    GLADE_BASE_EDITOR_MENU_GWIDGET, &gparent,
+				    GLADE_BASE_EDITOR_GWIDGET, &gparent,
 				    -1);
 	else
 		gparent = e->gcontainer;
@@ -918,7 +1042,7 @@
 		GtkTreeIter iter;
 		if (glade_base_editor_find_child (e, widget, &iter))
 		{
-			glade_base_editor_store_remove (e, &iter);
+			gtk_tree_store_remove (GTK_TREE_STORE (e->priv->model), &iter);
 			glade_base_editor_clear (e);
 		}
 	}
@@ -957,14 +1081,14 @@
 	gchar *name;
 	
 	gtk_tree_model_get (model, iter,
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, &gchild,
+			    GLADE_BASE_EDITOR_GWIDGET, &gchild,
 			    -1);
 	
 	name = glade_base_editor_get_display_name (editor, gchild);
 		
-	glade_base_editor_store_set (editor, iter,
-				     GLADE_BASE_EDITOR_MENU_NAME, name,
-				     -1);
+	gtk_tree_store_set (GTK_TREE_STORE (editor->priv->model), iter,
+			    GLADE_BASE_EDITOR_NAME, name,
+			    -1);
 	g_free (name);
 	
 	return FALSE;
@@ -1023,12 +1147,17 @@
 	
 	if (container == NULL)
 	{
+		/* XXX Destroy childtypetabs ...*/
+
 		e->gcontainer = NULL;
 		e->project = NULL;
 		glade_base_editor_block_callbacks (editor, TRUE);
 		glade_base_editor_clear (editor);
-		glade_base_editor_store_clear (editor);
-		gtk_list_store_clear (e->children);
+
+		gtk_tree_view_set_model (GTK_TREE_VIEW (editor->priv->treeview), NULL);
+		gtk_tree_store_clear (GTK_TREE_STORE (editor->priv->model));
+		gtk_tree_view_set_model (GTK_TREE_VIEW (editor->priv->treeview), editor->priv->model);
+
 		gtk_widget_set_sensitive (e->paned, FALSE);
 		glade_base_editor_block_callbacks (editor, FALSE);
 		g_object_notify (G_OBJECT (editor), "container");
@@ -1070,6 +1199,8 @@
 glade_base_editor_finalize (GObject *object)
 {
 	GladeBaseEditor *cobj = GLADE_BASE_EDITOR (object);
+
+	/* XXX Free up ChildTypeTabs here... */
 	
 	/* Free private members, etc. */
 	glade_base_editor_project_disconnect (cobj);
@@ -1131,12 +1262,13 @@
 	GtkTreeIter             iter;
 	gchar                  *name, *class_name;
 
+	parent = glade_widget_get_parent (gchild);
+
 	if (glade_base_editor_get_type_info (editor, NULL, type,
-					     GLADE_BASE_EDITOR_NAME, &class_name,
+					     GLADE_BASE_EDITOR_CLASS_NAME, &class_name,
 					     -1) == FALSE)
 		return TRUE;
 	
-	parent = glade_widget_get_parent (gchild);
 	child = glade_widget_get_object (gchild);
 	name = g_strdup (glade_widget_get_name (gchild));
 	glade_base_editor_find_child (editor, gchild, &iter);
@@ -1194,10 +1326,10 @@
 	if (GTK_IS_WIDGET (child_new))
 		gtk_widget_show_all (GTK_WIDGET (child_new));
 	
-	glade_base_editor_store_set (editor, &iter,
-			    GLADE_BASE_EDITOR_MENU_GWIDGET, gchild_new,
-			    GLADE_BASE_EDITOR_MENU_OBJECT, child_new,
-			    GLADE_BASE_EDITOR_MENU_TYPE_NAME, class_name,
+	gtk_tree_store_set (GTK_TREE_STORE (editor->priv->model), &iter,
+			    GLADE_BASE_EDITOR_GWIDGET, gchild_new,
+			    GLADE_BASE_EDITOR_OBJECT, child_new,
+			    GLADE_BASE_EDITOR_TYPE_NAME, class_name,
 			    -1);
 	g_free (class_name);
 	g_free (name);
@@ -1446,10 +1578,6 @@
 	
 	e = editor->priv = g_new0(GladeBaseEditorPrivate, 1);
 	
-	/* Children store */
-	e->children = gtk_list_store_new (GLADE_BASE_EDITOR_N_COLUMNS,
-					  G_TYPE_GTYPE, G_TYPE_STRING);
-
 	/* Paned */
 	e->paned = paned = gtk_vpaned_new ();
 	gtk_widget_show (paned);
@@ -1485,22 +1613,30 @@
 	g_signal_connect (e->treeview, "cursor-changed",
 			  G_CALLBACK (glade_base_editor_treeview_cursor_changed), editor);
 
+	g_signal_connect (e->treeview, "button-press-event",
+			  G_CALLBACK (glade_base_editor_popup_handler), editor);
+	
+
 	renderer = gtk_cell_renderer_text_new ();
 	column = gtk_tree_view_column_new_with_attributes (_("Label"), renderer,
-						"text", GLADE_BASE_EDITOR_MENU_NAME, NULL);
+							   "text", GLADE_BASE_EDITOR_NAME, NULL);
 	gtk_tree_view_append_column (GTK_TREE_VIEW (e->treeview), column);
 	
 	renderer = gtk_cell_renderer_combo_new ();
 	g_object_set (renderer,
-			"model", e->children,
-			"text-column", GLADE_BASE_EDITOR_NAME,
-			"has-entry", FALSE,
-			"editable", TRUE,
-			NULL);
-	g_signal_connect (renderer, "edited", 
+		      "has-entry", FALSE,
+		      "text-column", GLADE_BASE_EDITOR_CLASS_NAME,
+		      "editable", TRUE,
+		      NULL);
+
+	g_signal_connect (G_OBJECT (renderer), "edited", 
 			  G_CALLBACK (glade_base_editor_child_type_edited), editor);
+
 	column = gtk_tree_view_column_new_with_attributes (_("Type"), renderer,
-						"text", GLADE_BASE_EDITOR_MENU_TYPE_NAME, NULL);
+							   "text", GLADE_BASE_EDITOR_TYPE_NAME, 
+							   "model", GLADE_BASE_EDITOR_CHILD_TYPES,
+							   NULL);
+
 	gtk_tree_view_append_column (GTK_TREE_VIEW (e->treeview), column);
 
 	gtk_container_add (GTK_CONTAINER (scroll), e->treeview);
@@ -1583,11 +1719,10 @@
 /**
  * glade_base_editor_new:
  * @container: the container this new editor will edit.
- * @tree_like: TRUE if container's children can have children.
  * @... A NULL terminated list of gchar *, GType
  * 
- * Creates a new GladeBaseEditor with support for all the object types indicated
- * in the variable argument list.
+ * Creates a new GladeBaseEditor with @container toplevel 
+ * support for all the object types indicated in the variable argument list.
  * Argument List:
  *   o The type name
  *   o The GType the editor will support
@@ -1595,38 +1730,28 @@
  * Returns: a new GladeBaseEditor.
  */
 GladeBaseEditor *
-glade_base_editor_new (GObject *container, gboolean tree_like, ...)
+glade_base_editor_new (GObject *container, ...)
 {
+	ChildTypeTab *child_type;
 	GladeBaseEditor *editor;
 	GladeBaseEditorPrivate *e;
-	va_list args;
+	GtkTreeIter iter;	
+	GType       iter_type;
 	gchar *name;
-	GtkTreeIter iter;
-	
+	va_list args;
+
 	g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
 	
 	editor = GLADE_BASE_EDITOR (g_object_new (GLADE_TYPE_BASE_EDITOR, NULL));
 	e = editor->priv;
 	
 	/* Store */
-	if (tree_like)
-	{
-		e->tstore = gtk_tree_store_new (GLADE_BASE_EDITOR_MENU_N_COLUMNS,
-						G_TYPE_OBJECT,
-						G_TYPE_OBJECT,
-						G_TYPE_STRING,
-						G_TYPE_STRING);
-		e->model = GTK_TREE_MODEL (e->tstore);
-	}
-	else
-	{
-		e->lstore = gtk_list_store_new (GLADE_BASE_EDITOR_MENU_N_COLUMNS,
-						G_TYPE_OBJECT,
-						G_TYPE_OBJECT,
-						G_TYPE_STRING,
-						G_TYPE_STRING);
-		e->model = GTK_TREE_MODEL (e->lstore);
-	}
+	e->model = (GtkTreeModel *)gtk_tree_store_new (GLADE_BASE_EDITOR_N_COLUMNS,
+						       G_TYPE_OBJECT,
+						       G_TYPE_OBJECT,
+						       G_TYPE_STRING,
+						       G_TYPE_STRING,
+						       GTK_TYPE_TREE_MODEL);
 
 	gtk_tree_view_set_model	 (GTK_TREE_VIEW (e->treeview), e->model);
 	gtk_tree_view_expand_all (GTK_TREE_VIEW (e->treeview));
@@ -1635,25 +1760,82 @@
 			  G_CALLBACK (glade_base_editor_row_inserted), 
 			  editor);
 	
-	va_start (args, tree_like);
-	
+	child_type              = g_new0 (ChildTypeTab, 1);
+	child_type->parent_type = G_OBJECT_TYPE (container);
+	child_type->children    = (GtkTreeModel *)gtk_list_store_new (GLADE_BASE_EDITOR_TYPES_N_COLUMNS,
+								      G_TYPE_GTYPE, G_TYPE_STRING);
+
+	va_start (args, container);
 	while ((name = va_arg (args, gchar *)))
 	{
-		gtk_list_store_append (editor->priv->children, &iter);
-		gtk_list_store_set (editor->priv->children, &iter,
-				    GLADE_BASE_EDITOR_GTYPE, va_arg (args, GType),
-				    GLADE_BASE_EDITOR_NAME, name,
+		iter_type = va_arg (args, GType);
+
+		gtk_list_store_append (GTK_LIST_STORE (child_type->children), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (child_type->children), &iter,
+				    GLADE_BASE_EDITOR_GTYPE, iter_type,
+				    GLADE_BASE_EDITOR_CLASS_NAME, name,
 				    -1);
-	}
 
+		if (editor->priv->add_type == 0)
+		{
+			editor->priv->add_type = iter_type;
+			editor->priv->add_as_child = FALSE;
+		}
+	}
 	va_end (args);
-	
+
+	e->child_types = g_list_prepend (e->child_types, child_type);
+
 	glade_base_editor_set_container (editor, container);
 	
 	return editor;
 }
 
 
+
+/**
+ * glade_base_editor_append_types:
+ * @editor: A #GladeBaseEditor
+ * @parent_type: the parent type these child types will apply to
+ * @... A NULL terminated list of gchar *, GType
+ * 
+ * Appends support for all the object types indicated in the variable argument list.
+ * Argument List:
+ *   o The type name
+ *   o The GType the editor will support for parents of type @type
+ *
+ */
+void
+glade_base_editor_append_types (GladeBaseEditor *editor, GType parent_type, ...)
+{
+	ChildTypeTab *child_type;
+	GtkTreeIter iter;
+	gchar *name;
+	va_list args;
+
+	g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
+	g_return_if_fail (get_children_model_for_type (editor, parent_type) == NULL);
+	
+	child_type              = g_new0 (ChildTypeTab, 1);
+	child_type->parent_type = parent_type;
+	child_type->children    = (GtkTreeModel *)gtk_list_store_new (GLADE_BASE_EDITOR_TYPES_N_COLUMNS,
+								      G_TYPE_GTYPE, G_TYPE_STRING);
+
+	va_start (args, parent_type);
+	while ((name = va_arg (args, gchar *)))
+	{
+		gtk_list_store_append (GTK_LIST_STORE (child_type->children), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (child_type->children), &iter,
+				    GLADE_BASE_EDITOR_GTYPE, va_arg (args, GType),
+				    GLADE_BASE_EDITOR_CLASS_NAME, name,
+				    -1);
+	}
+	va_end (args);
+
+	editor->priv->child_types = g_list_insert_sorted (editor->priv->child_types, child_type,
+							  (GCompareFunc)sort_type_by_hierarchy);
+}
+
 /**
  * glade_base_editor_add_default_properties:
  * @editor: a #GladeBaseEditor
@@ -1667,16 +1849,20 @@
 glade_base_editor_add_default_properties (GladeBaseEditor *editor,
 					  GladeWidget *gchild)
 {
-	GladeBaseEditorPrivate *e = editor->priv;
 	GtkTreeIter combo_iter;
 	GtkWidget *label, *entry;
-	GtkTreeModel *child_class = GTK_TREE_MODEL (e->children);
+	GtkTreeModel *child_class;
 	GtkCellRenderer *renderer;
 	gboolean retval;
+	GladeWidget *gparent;
 	GObject *child = glade_widget_get_object (gchild);
 	
 	g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
 	g_return_if_fail (GLADE_IS_WIDGET (gchild));
+	g_return_if_fail (GLADE_IS_WIDGET (gchild->parent));
+
+	gparent = glade_widget_get_parent (gchild);
+	child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (gparent->object));
 	
 	/* Name */
 	label = gtk_label_new (_("Name :"));
@@ -1688,23 +1874,27 @@
 	g_signal_connect (entry, "focus-out-event", G_CALLBACK (glade_base_editor_name_focus_out), gchild);
 	glade_base_editor_table_attach (editor, label, entry);
 
-	/* Type */
-	label = gtk_label_new (_("Type :"));
-	gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.0);
-	
-	entry = gtk_combo_box_new ();
-	gtk_combo_box_set_model (GTK_COMBO_BOX (entry), child_class);
-	
-	renderer = gtk_cell_renderer_text_new ();
-	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (entry), renderer, FALSE);
-	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (entry), renderer, "text",
-					GLADE_BASE_EDITOR_NAME, NULL);
-					
-	if ((retval = glade_base_editor_get_type_info (editor, &combo_iter, G_OBJECT_TYPE (child), -1)))
-		gtk_combo_box_set_active_iter (GTK_COMBO_BOX (entry), &combo_iter);
+	if (child_class)
+	{
+		/* Type */
+		label = gtk_label_new (_("Type :"));
+		gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.0);
+		
+		entry = gtk_combo_box_new ();
+		gtk_combo_box_set_model (GTK_COMBO_BOX (entry), child_class);
+		
+		renderer = gtk_cell_renderer_text_new ();
+		gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (entry), renderer, FALSE);
+		gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (entry), renderer, "text",
+						GLADE_BASE_EDITOR_CLASS_NAME, NULL);
+		
+		if ((retval = glade_base_editor_get_type_info (editor, &combo_iter, 
+							       G_OBJECT_TYPE (child), -1)))
+			gtk_combo_box_set_active_iter (GTK_COMBO_BOX (entry), &combo_iter);
 	
-	g_signal_connect (entry, "changed", G_CALLBACK (glade_base_editor_type_changed), editor);
-	glade_base_editor_table_attach (editor, label, entry);
+		g_signal_connect (entry, "changed", G_CALLBACK (glade_base_editor_type_changed), editor);
+		glade_base_editor_table_attach (editor, label, entry);
+	}
 }
 
 /**
@@ -1816,72 +2006,6 @@
 }
 
 /**
- * glade_base_editor_add_popup_items:
- * @editor: a #GladeBaseEditor
- * @...: a NULL terminated list of gchar *, #GType, gboolean
- *
- * Adds a new popup item to the editor.
- * Three parameters are needed for each new popup item:
- *  o the popup item's label
- *  o the object type this popup item will create
- *  o whether this popup item will add the new object as child
- */
-void
-glade_base_editor_add_popup_items (GladeBaseEditor *editor, ...)
-{
-	va_list args;
-	GtkMenuShell *menu;
-	GtkWidget *item;
-	gchar *label;
-	GType type;
-	gboolean as_child;
-	
-	g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
-	
-	if (editor->priv->popup == NULL)
-	{
-		/* Create PopUp */
-		editor->priv->popup = gtk_menu_new ();
-		gtk_widget_show (editor->priv->popup);
-		g_signal_connect (editor->priv->treeview, "button-press-event", 
-				  G_CALLBACK (glade_base_editor_popup_handler),
-				  editor);
-	}
-
-	menu = GTK_MENU_SHELL (editor->priv->popup);
-	
-	va_start (args, editor);
-	
-	while ((label = va_arg (args, gchar *)))
-	{
-		type = va_arg (args, GType);
-		as_child = va_arg (args, gboolean);
-		
-		if (!glade_base_editor_get_type_info (editor, NULL, type, -1))
-			continue;
-		
-		item = gtk_menu_item_new_with_label (label);
-		gtk_widget_show (item);
-		
-		g_object_set_data (G_OBJECT (item), "object_type",
-				   GINT_TO_POINTER (type));
-		
-		g_object_set_data (G_OBJECT (item), "object_as_child",
-				   GINT_TO_POINTER (as_child));
-		
-		if (editor->priv->add_type == 0)
-		{
-			editor->priv->add_type = type;
-			editor->priv->add_as_child = as_child;
-		}
-		
-		g_signal_connect (item, "activate", 
-				  G_CALLBACK (glade_base_editor_add_item_activate), editor);
-		gtk_menu_shell_append (menu, item);
-	}
-}
-
-/**
  * glade_base_editor_set_show_signal_editor:
  * @editor: a #GladeBaseEditor
  * @val:

Modified: trunk/gladeui/glade-base-editor.h
==============================================================================
--- trunk/gladeui/glade-base-editor.h	(original)
+++ trunk/gladeui/glade-base-editor.h	Sat Nov 22 18:35:11 2008
@@ -62,8 +62,11 @@
 GType                glade_base_editor_get_type               (void);
 
 GladeBaseEditor     *glade_base_editor_new                    (GObject *container,
-								 gboolean tree_like,
-								 ...);
+							       ...);
+
+void                 glade_base_editor_append_types           (GladeBaseEditor *editor, 
+							       GType parent_type,
+							       ...);
 
 void                 glade_base_editor_add_editable           (GladeBaseEditor *editor,
 							       GladeWidget     *gchild);
@@ -79,9 +82,6 @@
 void                 glade_base_editor_add_label              (GladeBaseEditor *editor,
 							       gchar *str);
 
-void                 glade_base_editor_add_popup_items        (GladeBaseEditor *editor,
-							       ...);
-
 void                 glade_base_editor_set_show_signal_editor (GladeBaseEditor *editor,
 							       gboolean val);
 

Modified: trunk/plugins/gtk+/glade-gtk.c
==============================================================================
--- trunk/plugins/gtk+/glade-gtk.c	(original)
+++ trunk/plugins/gtk+/glade-gtk.c	Sat Nov 22 18:35:11 2008
@@ -5737,17 +5737,26 @@
 }
 
 static gchar *
-glade_gtk_menu_shell_get_display_name (GladeBaseEditor *editor,
-				       GladeWidget *gchild,
-				       gpointer user_data)
+glade_gtk_menu_shell_tool_item_get_display_name (GladeBaseEditor *editor,
+						 GladeWidget *gchild,
+						 gpointer user_data)
 {
 	GObject *child = glade_widget_get_object (gchild);
 	gchar *name;
 	
-	if (GTK_IS_SEPARATOR_MENU_ITEM (child))
+	if (GTK_IS_SEPARATOR_MENU_ITEM (child) ||
+	    GTK_IS_SEPARATOR_TOOL_ITEM (child))
 		name = _("<separator>");
-	else
+	else if (GTK_IS_MENU_ITEM (child))
+		glade_widget_property_get (gchild, "label", &name);
+	else if (GTK_IS_TOOL_BUTTON (child))
+	{
 		glade_widget_property_get (gchild, "label", &name);
+		if (name == NULL || strlen (name) == 0)
+			glade_widget_property_get (gchild, "stock-id", &name);
+	}
+	else
+		name = _("<custom>");
 	
 	return g_strdup (name);
 }
@@ -5755,13 +5764,19 @@
 static GladeWidget *
 glade_gtk_menu_shell_item_get_parent (GladeWidget *gparent, GObject *parent)
 {
-	GtkWidget *submenu;
+	GtkWidget *submenu = NULL;
 	
-	if ((submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (parent))))
+	if (GTK_IS_MENU_TOOL_BUTTON (parent))
+		submenu = gtk_menu_tool_button_get_menu (GTK_MENU_TOOL_BUTTON (parent));
+	else if (GTK_IS_MENU_ITEM (parent))
+		submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (parent));
+
+	if (submenu)
 		gparent = glade_widget_get_from_gobject (submenu);
 	else
 		gparent = glade_command_create (glade_widget_adaptor_get_by_type (GTK_TYPE_MENU),
 						gparent, NULL, glade_widget_get_project (gparent));
+
 	return gparent;
 }
 
@@ -5778,7 +5793,7 @@
 		return NULL;
 	
 	/* Get or build real parent */
-	if (GTK_IS_MENU_ITEM (parent))
+	if (GTK_IS_MENU_ITEM (parent) || GTK_IS_MENU_TOOL_BUTTON (parent))
 		gparent = glade_gtk_menu_shell_item_get_parent (gparent, parent);
 	
 	/* Build child */
@@ -5831,31 +5846,51 @@
 				 GladeWidget *gparent,
 				 GladeWidget *gchild,
 				 gpointer data)
-{
+{	
 	GObject *parent = glade_widget_get_object (gparent);
+	GObject *child  = glade_widget_get_object (gchild);
 	GladeWidget *old_parent = gchild->parent;
 	GList list = {0, };
 	
-	if (GTK_IS_SEPARATOR_MENU_ITEM (parent)) return FALSE;
-	
-	if (GTK_IS_MENU_ITEM (parent))
-		gparent = glade_gtk_menu_shell_item_get_parent (gparent, parent);
+	if (GTK_IS_SEPARATOR_MENU_ITEM (parent) ||
+	    GTK_IS_SEPARATOR_TOOL_ITEM (parent)) 
+		return FALSE;
 
-	/* Delete dangling menus */
-	if (GTK_IS_MENU (old_parent->object) && 
-	    old_parent->parent && GTK_IS_MENU_ITEM (old_parent->parent->object))
-	{
-		GList del = { 0, };
-		del.data = old_parent;
-		glade_command_delete (&del);
-	}
+	if (GTK_IS_MENU_ITEM (child) && GTK_IS_TOOLBAR (parent))
+		return FALSE;
+
+	if (GTK_IS_TOOL_ITEM (child) && 
+	    (GTK_IS_MENU (parent) || GTK_IS_MENU_BAR (parent) || GTK_IS_MENU_ITEM (parent)))
+		return FALSE;
+
+	if (GTK_IS_TOOL_ITEM (parent) && 
+	    (!GTK_IS_MENU_TOOL_BUTTON (parent) || !GTK_IS_MENU_ITEM (child)))
+		return FALSE;
+
+	if (GTK_IS_MENU_ITEM (parent) || GTK_IS_MENU_TOOL_BUTTON (parent))
+		gparent = glade_gtk_menu_shell_item_get_parent (gparent, parent);
 	
 	if (gparent != glade_widget_get_parent (gchild))
 	{
 		list.data = gchild;
 		glade_command_dnd (&list, gparent, NULL);
 	}
-	
+
+	/* Delete dangling childless menus */
+	if (GTK_IS_MENU (old_parent->object) && 
+	    old_parent->parent && GTK_IS_MENU_ITEM (old_parent->parent->object))
+	{
+		GList del = { 0, }, *children;
+
+		children = gtk_container_get_children (GTK_CONTAINER (old_parent->object));
+		if (!children)
+		{
+			del.data = old_parent;
+			glade_command_delete (&del);
+		}
+		g_list_free (children);
+	}
+
 	return TRUE;
 }
 
@@ -5867,6 +5902,15 @@
 {
 	GObject *child = glade_widget_get_object (gchild);
 	
+
+	if ((type == GTK_TYPE_SEPARATOR_MENU_ITEM &&
+	     gtk_menu_item_get_submenu (GTK_MENU_ITEM (child))) ||
+	    (GTK_IS_MENU_TOOL_BUTTON (child) &&
+	     gtk_menu_tool_button_get_menu (GTK_MENU_TOOL_BUTTON (child))))
+	    return TRUE;
+
+	g_print ("Changing type of %s to %s\n", gchild->name, g_type_name (type));
+
 	/* Delete the internal image of an image menu item before going ahead and changing types. */
 	if (GTK_IS_IMAGE_MENU_ITEM (child))
 	{
@@ -5881,22 +5925,46 @@
 			glade_command_delete (&list);
 		}
 	}
-
-	if (type == GTK_TYPE_SEPARATOR_MENU_ITEM &&
-	    gtk_menu_item_get_submenu (GTK_MENU_ITEM (child)))
-		return TRUE;
 		
 	return FALSE;
 }
 
 static void
-glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor,
-				     GladeWidget *gchild,
-				     gpointer data)
+glade_gtk_toolbar_child_selected (GladeBaseEditor *editor,
+				  GladeWidget *gchild,
+				  gpointer data)
 {
 	GObject *child = glade_widget_get_object (gchild);
 	GType type = G_OBJECT_TYPE (child);
 	
+	glade_base_editor_add_label (editor, "Tool Item");
+	
+	glade_base_editor_add_default_properties (editor, gchild);
+	
+	glade_base_editor_add_label (editor, "Properties");
+	glade_base_editor_add_editable (editor, gchild);
+	
+	if (type == GTK_TYPE_SEPARATOR_TOOL_ITEM) return;
+
+	glade_base_editor_add_label (editor, "Packing");
+	glade_base_editor_add_properties (editor, gchild, TRUE,
+					  "expand", "homogeneous", NULL);
+
+}
+
+static void
+glade_gtk_menu_shell_tool_item_child_selected (GladeBaseEditor *editor,
+					       GladeWidget *gchild,
+					       gpointer data)
+{
+	GObject *child = glade_widget_get_object (gchild);
+	GType type = G_OBJECT_TYPE (child);
+
+	if (GTK_IS_TOOL_ITEM (child))
+	{
+		glade_gtk_toolbar_child_selected (editor, gchild, data);
+		return;
+	}	
 	glade_base_editor_add_label (editor, "Menu Item");
 	
 	glade_base_editor_add_default_properties (editor, gchild);
@@ -5932,7 +6000,7 @@
 	GtkWidget *window;
 
 	/* Editor */
-	editor = glade_base_editor_new (object, TRUE,
+	editor = glade_base_editor_new (object, 
 					_("Normal"), GTK_TYPE_MENU_ITEM,
 					_("Image"), GTK_TYPE_IMAGE_MENU_ITEM,
 					_("Check"), GTK_TYPE_CHECK_MENU_ITEM,
@@ -5940,14 +6008,16 @@
 					_("Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM,
 					NULL);
 
-	glade_base_editor_add_popup_items (editor,
-					  _("Add Item"), GTK_TYPE_MENU_ITEM, FALSE,
-					  _("Add Child Item"), GTK_TYPE_MENU_ITEM, TRUE,
-					  _("Add Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM, FALSE,
-					  NULL);
+	glade_base_editor_append_types (editor, GTK_TYPE_MENU_ITEM,
+					_("Normal"), GTK_TYPE_MENU_ITEM,
+					_("Image"), GTK_TYPE_IMAGE_MENU_ITEM,
+					_("Check"), GTK_TYPE_CHECK_MENU_ITEM,
+					_("Radio"), GTK_TYPE_RADIO_MENU_ITEM,
+					_("Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM,
+					NULL);
 	
-	g_signal_connect (editor, "get-display-name", G_CALLBACK (glade_gtk_menu_shell_get_display_name), NULL);
-	g_signal_connect (editor, "child-selected", G_CALLBACK (glade_gtk_menu_shell_child_selected), NULL);
+	g_signal_connect (editor, "get-display-name", G_CALLBACK (glade_gtk_menu_shell_tool_item_get_display_name), NULL);
+	g_signal_connect (editor, "child-selected", G_CALLBACK (glade_gtk_menu_shell_tool_item_child_selected), NULL);
 	g_signal_connect (editor, "change-type", G_CALLBACK (glade_gtk_menu_shell_change_type), NULL);
 	g_signal_connect (editor, "build-child", G_CALLBACK (glade_gtk_menu_shell_build_child), NULL);
 	g_signal_connect (editor, "delete-child", G_CALLBACK (glade_gtk_menu_shell_delete_child), NULL);
@@ -6885,79 +6955,48 @@
 	gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
 }
 
-static gchar *
-glade_gtk_toolbar_get_display_name (GladeBaseEditor *editor,
-				    GladeWidget *gchild,
-				    gpointer user_data)
-{
-	GObject *child = glade_widget_get_object (gchild);
-	gchar *name;
-	
-	if (GTK_IS_SEPARATOR_TOOL_ITEM (child))
-		name = _("<separator>");
-	else
-	if (GTK_IS_TOOL_BUTTON (child))
-	{
-		glade_widget_property_get (gchild, "label", &name);
-		if (name == NULL || strlen (name) == 0)
-			glade_widget_property_get (gchild, "stock-id", &name);
-	}
-	else
-		name = _("<custom>");
-	
-	return g_strdup (name);
-}
-
-static void
-glade_gtk_toolbar_child_selected (GladeBaseEditor *editor,
-				  GladeWidget *gchild,
-				  gpointer data)
-{
-	GObject *child = glade_widget_get_object (gchild);
-	GType type = G_OBJECT_TYPE (child);
-	
-	glade_base_editor_add_label (editor, "Tool Item");
-	
-	glade_base_editor_add_default_properties (editor, gchild);
-	
-	glade_base_editor_add_label (editor, "Properties");
-	glade_base_editor_add_editable (editor, gchild);
-	
-	if (type == GTK_TYPE_SEPARATOR_TOOL_ITEM) return;
-
-	glade_base_editor_add_label (editor, "Packing");
-	glade_base_editor_add_properties (editor, gchild, TRUE,
-					  "expand", "homogeneous", NULL);
-
-}
-
 static void
 glade_gtk_toolbar_launch_editor (GladeWidgetAdaptor *adaptor, 
 				 GObject            *toolbar)
 {
 	GladeBaseEditor *editor;
 	GtkWidget *window;
+
 	/* Editor */
-	editor = glade_base_editor_new (toolbar, FALSE,
+	editor = glade_base_editor_new (toolbar, 
 					_("Button"), GTK_TYPE_TOOL_BUTTON,
 					_("Toggle"), GTK_TYPE_TOGGLE_TOOL_BUTTON,
 					_("Radio"), GTK_TYPE_RADIO_TOOL_BUTTON,
 					_("Menu"), GTK_TYPE_MENU_TOOL_BUTTON,
-					_("Item"), GTK_TYPE_TOOL_ITEM,
+					_("Custom"), GTK_TYPE_TOOL_ITEM,
 					_("Separator"), GTK_TYPE_SEPARATOR_TOOL_ITEM,
 					NULL);
 
-	glade_base_editor_add_popup_items (editor,
-					  _("Add Tool Button"), GTK_TYPE_TOOL_BUTTON, FALSE, 
-					  _("Add Toggle Button"), GTK_TYPE_TOGGLE_TOOL_BUTTON, FALSE, 
-					  _("Add Radio Button"), GTK_TYPE_RADIO_TOOL_BUTTON, FALSE, 
-					  _("Add Menu Button"), GTK_TYPE_MENU_TOOL_BUTTON, FALSE, 
-					  _("Add Tool Item"), GTK_TYPE_TOOL_ITEM, FALSE, 
-					  _("Add Separator"), GTK_TYPE_SEPARATOR_TOOL_ITEM, FALSE,
-					  NULL);
+
+	glade_base_editor_append_types (editor, GTK_TYPE_MENU_TOOL_BUTTON,
+					_("Normal"), GTK_TYPE_MENU_ITEM,
+					_("Image"), GTK_TYPE_IMAGE_MENU_ITEM,
+					_("Check"), GTK_TYPE_CHECK_MENU_ITEM,
+					_("Radio"), GTK_TYPE_RADIO_MENU_ITEM,
+					_("Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM,
+					NULL);
 	
-	g_signal_connect (editor, "get-display-name", G_CALLBACK (glade_gtk_toolbar_get_display_name), NULL);
-	g_signal_connect (editor, "child-selected", G_CALLBACK (glade_gtk_toolbar_child_selected), NULL);
+
+	glade_base_editor_append_types (editor, GTK_TYPE_MENU_ITEM,
+					_("Normal"), GTK_TYPE_MENU_ITEM,
+					_("Image"), GTK_TYPE_IMAGE_MENU_ITEM,
+					_("Check"), GTK_TYPE_CHECK_MENU_ITEM,
+					_("Radio"), GTK_TYPE_RADIO_MENU_ITEM,
+					_("Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM,
+					NULL);
+
+
+	g_signal_connect (editor, "get-display-name", G_CALLBACK (glade_gtk_menu_shell_tool_item_get_display_name), NULL);
+	g_signal_connect (editor, "child-selected", G_CALLBACK (glade_gtk_menu_shell_tool_item_child_selected), NULL);
+	g_signal_connect (editor, "change-type", G_CALLBACK (glade_gtk_menu_shell_change_type), NULL);
+	g_signal_connect (editor, "build-child", G_CALLBACK (glade_gtk_menu_shell_build_child), NULL);
+	g_signal_connect (editor, "delete-child", G_CALLBACK (glade_gtk_menu_shell_delete_child), NULL);
+	g_signal_connect (editor, "move-child", G_CALLBACK (glade_gtk_menu_shell_move_child), NULL);
 
 	gtk_widget_show (GTK_WIDGET (editor));
 	
@@ -7225,6 +7264,48 @@
 			  widget);
 }
 
+/* ----------------------------- GtkMenuToolButton ------------------------------ */
+GList *
+glade_gtk_menu_tool_button_get_children (GladeWidgetAdaptor *adaptor, GtkMenuToolButton *button)
+{
+	GList *list = NULL;
+	GtkWidget *menu = gtk_menu_tool_button_get_menu (button);
+
+	list = glade_util_container_get_all_children (GTK_CONTAINER (button));
+
+	/* Ensure that we only return one 'menu' */
+	if (menu && g_list_find (list, menu) == NULL)
+		list = g_list_append (list, menu);
+
+	return list;
+}
+
+void
+glade_gtk_menu_tool_button_add_child (GladeWidgetAdaptor *adaptor,
+				      GObject *object, 
+				      GObject *child)
+{
+	if (GTK_IS_MENU (child))
+	{
+		gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (object), GTK_WIDGET (child));
+	}
+	else
+		GWA_GET_CLASS (GTK_TYPE_TOOL_BUTTON)->add (adaptor, object, child);
+}
+
+void
+glade_gtk_menu_tool_button_remove_child (GladeWidgetAdaptor *adaptor,
+					 GObject *object, 
+					 GObject *child)
+{
+	if (GTK_IS_MENU (child))
+	{
+		gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (object), NULL);
+	}
+	else
+		GWA_GET_CLASS (GTK_TYPE_TOOL_BUTTON)->remove (adaptor, object, child);
+}
+
 /* ----------------------------- GtkLabel ------------------------------ */
 void
 glade_gtk_label_post_create (GladeWidgetAdaptor *adaptor,
@@ -10207,9 +10288,6 @@
 	}
 }
 
-
-
-
 GladeEditorProperty *
 glade_gtk_cell_renderer_create_eprop (GladeWidgetAdaptor *adaptor,
 				      GladePropertyClass *klass,

Modified: trunk/plugins/gtk+/gtk+.xml.in
==============================================================================
--- trunk/plugins/gtk+/gtk+.xml.in	(original)
+++ trunk/plugins/gtk+/gtk+.xml.in	Sat Nov 22 18:35:11 2008
@@ -485,7 +485,7 @@
       <remove-child-function>glade_gtk_image_menu_item_remove_child</remove-child-function>
       <create-editable-function>glade_gtk_image_menu_item_create_editable</create-editable-function>
       <properties>
-        <property id="use-stock" visible="False">
+        <property id="use-stock" default="True" visible="False">
 	  <parameter-spec>
 	    <type>GParamBoolean</type>
 	  </parameter-spec>
@@ -669,7 +669,12 @@
     
     <glade-widget-class name="GtkRadioToolButton" generic-name="radiotoolbutton" _title="Radio Tool Button"/>
     
-    <glade-widget-class name="GtkMenuToolButton" generic-name="menutoolbutton" _title="Menu Tool Button"/>
+    <glade-widget-class name="GtkMenuToolButton" generic-name="menutoolbutton" _title="Menu Tool Button">
+      <add-child-function>glade_gtk_menu_tool_button_add_child</add-child-function>
+      <remove-child-function>glade_gtk_menu_tool_button_remove_child</remove-child-function>
+      <get-children-function>glade_gtk_menu_tool_button_get_children</get-children-function>
+    </glade-widget-class>
+
 
     <glade-widget-class name="GtkHandleBox" generic-name="handlebox" _title="Handle Box">
       <properties>
@@ -1935,7 +1940,7 @@
 
 	<!-- Cell renderer properties with thier virtual attribute and control properties -->
         <property id="cell-background" common="True" save="False" custom-layout="True"/>
-        <property id="attr-cell-background" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-cell-background" _name="Cell Background Color name column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -1949,7 +1954,7 @@
 	</property>
 
         <property id="cell-background-gdk" common="True" save="False" custom-layout="True"/>
-        <property id="attr-cell-background-gdk" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-cell-background-gdk" _name="Cell Background Color column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -1963,7 +1968,7 @@
 	</property>
 
         <property id="width" common="True" save="False" custom-layout="True"/>
-        <property id="attr-width" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-width" _name="Width column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -1977,7 +1982,7 @@
 	</property>
 
         <property id="height" common="True" save="False" custom-layout="True"/>
-        <property id="attr-height" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-height" _name="Height column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -1990,8 +1995,8 @@
 	  </parameter-spec>
 	</property>
 
-        <property id="xpad" _name="Horizontal padding" common="True" save="False" custom-layout="True"/>
-        <property id="attr-xpad" _name="Data column" save="False" default="-1" custom-layout="True">	
+        <property id="xpad" _name="Horizontal Padding" common="True" save="False" custom-layout="True"/>
+        <property id="attr-xpad" _name="Horizontal Padding column" save="False" default="-1" custom-layout="True">	
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2004,8 +2009,8 @@
 	  </parameter-spec>
 	</property>
 
-        <property id="ypad" _name="Vertical padding" common="True" save="False" custom-layout="True"/>
-        <property id="attr-ypad" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="ypad" _name="Vertical Padding" common="True" save="False" custom-layout="True"/>
+        <property id="attr-ypad" _name="Vertical Padding column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2018,8 +2023,8 @@
 	  </parameter-spec>
 	</property>
 
-        <property id="xalign" _name="Horizontal alignment" common="True" save="False" custom-layout="True"/>
-        <property id="attr-xalign" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="xalign" _name="Horizontal Alignment" common="True" save="False" custom-layout="True"/>
+        <property id="attr-xalign" _name="Horizontal Alignment column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2032,8 +2037,8 @@
 	  </parameter-spec>
 	</property>
 
-        <property id="yalign" _name="Vertical alignment" common="True" save="False" custom-layout="True"/>
-        <property id="attr-yalign" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="yalign" _name="Vertical Alignment" common="True" save="False" custom-layout="True"/>
+        <property id="attr-yalign" _name="Vertical Alignment column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2047,7 +2052,7 @@
 	</property>
 
         <property id="sensitive" common="True" save="False" custom-layout="True"/>
-        <property id="attr-sensitive" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-sensitive" _name="Sensitive column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2061,7 +2066,7 @@
 	</property>
 
         <property id="visible" _name="Visible" common="True" save="False" custom-layout="True"/>
-        <property id="attr-visible" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-visible" _name="Visible column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2097,7 +2102,7 @@
 	<property id="stretch-set" disabled="True"/>
 
         <property id="alignment" save="False" custom-layout="True"/>
-        <property id="attr-alignment" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-alignment" _name="Alignment column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2111,7 +2116,7 @@
 	</property>
 
         <property id="attributes" save="False" custom-layout="True"/>
-        <property id="attr-attributes" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-attributes" _name="Attributes column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2126,7 +2131,7 @@
 
 
         <property id="background" save="False" custom-layout="True"/>
-        <property id="attr-background" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-background" _name="Background Color Name column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2140,7 +2145,7 @@
 	</property>
 
         <property id="background-gdk" save="False" custom-layout="True"/>
-        <property id="attr-background-gdk" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-background-gdk" _name="Background Color column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2154,7 +2159,7 @@
 	</property>
 
         <property id="editable" save="False" custom-layout="True"/>
-        <property id="attr-editable" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-editable" _name="Editable column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2168,7 +2173,7 @@
 	</property>
 
         <property id="ellipsize" save="False" custom-layout="True"/>
-        <property id="attr-ellipsize" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-ellipsize" _name="Ellipsize column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2182,7 +2187,7 @@
 	</property>
 
         <property id="family" save="False" custom-layout="True"/>
-        <property id="attr-family" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-family" _name="Family column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2196,7 +2201,7 @@
 	</property>
 
         <property id="font" save="False" custom-layout="True"/>
-        <property id="attr-font" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-font" _name="Font column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2210,7 +2215,8 @@
 	</property>
 
         <property id="font-desc" save="False" custom-layout="True"/>
-        <property id="attr-font-desc" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-font-desc" _name="Font Description column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2224,7 +2230,8 @@
 	</property>
 
         <property id="foreground" save="False" custom-layout="True"/>
-        <property id="attr-foreground" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-foreground" _name="Foreground Color Name column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2238,7 +2245,8 @@
 	</property>
 
         <property id="foreground-gdk" save="False" custom-layout="True"/>
-        <property id="attr-foreground-gdk" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-foreground-gdk" _name="Foreground Color column" save="False" default="-1" 
+		  custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2252,7 +2260,7 @@
 	</property>
 
         <property id="language" save="False" custom-layout="True"/>
-        <property id="attr-language" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-language" _name="Language column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2266,7 +2274,7 @@
 	</property>
 
         <property id="markup" save="False" custom-layout="True"/>
-        <property id="attr-markup" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-markup" _name="Markup column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2280,7 +2288,7 @@
 	</property>
 
         <property id="rise" save="False" custom-layout="True"/>
-        <property id="attr-rise" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-rise" _name="Rise column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2294,7 +2302,7 @@
 	</property>
 
         <property id="scale" save="False" custom-layout="True"/>
-        <property id="attr-scale" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-scale" _name="Scale column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2308,7 +2316,8 @@
 	</property>
 
         <property id="single-paragraph-mode" save="False" custom-layout="True"/>
-        <property id="attr-single-paragraph-mode" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-single-paragraph-mode" _name="Single Paragraph Mode column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2322,7 +2331,7 @@
 	</property>
 
         <property id="size" save="False" custom-layout="True"/>
-        <property id="attr-size" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-size" _name="Size column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2350,7 +2359,7 @@
 	</property>
 
         <property id="stretch" save="False" custom-layout="True"/>
-        <property id="attr-stretch" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-stretch" _name="Stretch column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2364,7 +2373,7 @@
 	</property>
 
         <property id="strikethrough" save="False" custom-layout="True"/>
-        <property id="attr-strikethrough" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-strikethrough" _name="Strikethrough column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2378,7 +2387,7 @@
 	</property>
 
         <property id="style" save="False" custom-layout="True"/>
-        <property id="attr-style" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-style" _name="Style column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2392,7 +2401,7 @@
 	</property>
 
         <property id="text" save="False" custom-layout="True"/>
-        <property id="attr-text" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-text" _name="Text column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2406,7 +2415,7 @@
 	</property>
 
         <property id="underline" save="False" custom-layout="True"/>
-        <property id="attr-underline" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-underline" _name="Underline column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2420,7 +2429,7 @@
 	</property>
 
         <property id="variant" save="False" custom-layout="True"/>
-        <property id="attr-variant" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-variant" _name="Variant column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2434,7 +2443,7 @@
 	</property>
 
         <property id="weight" save="False" custom-layout="True"/>
-        <property id="attr-weight" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-weight" _name="Weight column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2448,7 +2457,7 @@
 	</property>
 
         <property id="width-chars" save="False" custom-layout="True"/>
-        <property id="attr-width-chars" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-width-chars" _name="Width in Characters column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2462,7 +2471,7 @@
 	</property>
 
         <property id="wrap-mode" save="False" custom-layout="True"/>
-        <property id="attr-wrap-mode" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-wrap-mode" _name="Wrap Mode column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2476,7 +2485,7 @@
 	</property>
 
         <property id="wrap-width" save="False" custom-layout="True"/>
-        <property id="attr-wrap-width" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-wrap-width" _name="Wrap Width column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2509,7 +2518,7 @@
 	</property>
 
         <property id="accel-mode" save="False" custom-layout="True"/>
-        <property id="attr-accel-mode" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-accel-mode" _name="Accelerator Mode column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2523,7 +2532,7 @@
 	</property>
 
         <property id="accel-mods" save="False" custom-layout="True"/>
-        <property id="attr-accel-mods" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-accel-mods" _name="Accelerator Modifiers column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2537,7 +2546,7 @@
 	</property>
 
         <property id="keycode" save="False" custom-layout="True"/>
-        <property id="attr-keycode" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-keycode" _name="Keycode column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2556,7 +2565,7 @@
 			libglade-unsupported="True">
       <properties>
         <property id="has-entry" save="False" custom-layout="True"/>
-        <property id="attr-has-entry" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-has-entry" _name="Has Entry column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2570,7 +2579,7 @@
 	</property>
 
         <property id="model" save="False" custom-layout="True"/>
-        <property id="attr-model" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-model" _name="Model column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2584,7 +2593,7 @@
 	</property>
 
         <property id="text-column" save="False" custom-layout="True"/>
-        <property id="attr-text-column" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-text-column" _name="Text Column column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2604,7 +2613,7 @@
 			libglade-unsupported="True">
       <properties>
         <property id="adjustment" save="False" custom-layout="True"/>
-        <property id="attr-adjustment" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-adjustment" _name="Adjustment column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2618,7 +2627,7 @@
 	</property>
 
         <property id="climb-rate" save="False" custom-layout="True"/>
-        <property id="attr-climb-rate" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-climb-rate" _name="Climb Rate column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2632,7 +2641,7 @@
 	</property>
 
         <property id="digits" save="False" custom-layout="True"/>
-        <property id="attr-digits" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-digits" _name="Digits column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2654,7 +2663,7 @@
         <property id="gicon" disabled="True"/>
 
         <property id="follow-state" save="False" custom-layout="True"/>
-        <property id="attr-follow-state" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-follow-state" _name="Follow State column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2667,8 +2676,8 @@
 	  </parameter-spec>
 	</property>
 
-        <property id="icon-name" save="False" custom-layout="True"/>
-        <property id="attr-icon-name" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="icon-name" save="False" themed-icon="True" custom-layout="True"/>
+        <property id="attr-icon-name" _name="Icon Name column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2682,7 +2691,7 @@
 	</property>
 
         <property id="pixbuf" save="False" custom-layout="True"/>
-        <property id="attr-pixbuf" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-pixbuf" _name="Pixbuf column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2696,7 +2705,8 @@
 	</property>
 
         <property id="pixbuf-expander-closed" save="False" custom-layout="True"/>
-        <property id="attr-pixbuf-expander-closed" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-pixbuf-expander-closed" _name="Pixbuf Expander Closed column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2710,7 +2720,8 @@
 	</property>
 
         <property id="pixbuf-expander-open" save="False" custom-layout="True"/>
-        <property id="attr-pixbuf-expander-open" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-pixbuf-expander-open" _name="Pixbuf Expander Open column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2724,7 +2735,7 @@
 	</property>
 
         <property id="stock-detail" save="False" custom-layout="True"/>
-        <property id="attr-stock-detail" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-stock-detail" _name="Stock Detail column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2737,8 +2748,8 @@
 	  </parameter-spec>
 	</property>
 
-        <property id="stock-id" save="False" custom-layout="True"/>
-        <property id="attr-stock-id" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="stock-id" save="False" stock-icon="True" custom-layout="True"/>
+        <property id="attr-stock-id" _name="Stock column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2752,7 +2763,7 @@
 	</property>
 
         <property id="stock-size" save="False" custom-layout="True"/>
-        <property id="attr-stock-size" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-stock-size" _name="Stock Size column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2771,7 +2782,7 @@
 			libglade-unsupported="True">
       <properties>
         <property id="orientation" save="False" custom-layout="True"/>
-        <property id="attr-orientation" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-orientation" _name="Orientation column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2785,7 +2796,7 @@
 	</property>
 
         <property id="pulse" save="False" custom-layout="True"/>
-        <property id="attr-pulse" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-pulse" _name="Pulse column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2799,7 +2810,7 @@
 	</property>
 
         <property id="text" save="False" custom-layout="True"/>
-        <property id="attr-text" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-text" _name="Text column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2813,7 +2824,8 @@
 	</property>
 
         <property id="text-xalign" save="False" custom-layout="True"/>
-        <property id="attr-text-xalign" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-text-xalign" _name="Text Horizontal Alignment column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2827,7 +2839,8 @@
 	</property>
 
         <property id="text-yalign" save="False" custom-layout="True"/>
-        <property id="attr-text-yalign" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-text-yalign" _name="Text Vertical Alignment column" save="False" 
+		  default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2841,7 +2854,7 @@
 	</property>
 
         <property id="value" save="False" custom-layout="True"/>
-        <property id="attr-value" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-value" _name="Value column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2860,7 +2873,7 @@
 			libglade-unsupported="True">
       <properties>
         <property id="activatable" save="False" custom-layout="True"/>
-        <property id="attr-activatable" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-activatable" _name="Activatable column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2874,7 +2887,7 @@
 	</property>
 
         <property id="active" save="False" custom-layout="True"/>
-        <property id="attr-active" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-active" _name="Active column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2888,7 +2901,7 @@
 	</property>
 
         <property id="inconsistent" save="False" custom-layout="True"/>
-        <property id="attr-inconsistent" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-inconsistent" _name="Inconsistent column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2902,7 +2915,7 @@
 	</property>
 
         <property id="indicator-size" save="False" custom-layout="True"/>
-        <property id="attr-indicator-size" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-indicator-size" _name="Indicator Size column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>
@@ -2916,7 +2929,7 @@
 	</property>
 
         <property id="radio" save="False" custom-layout="True"/>
-        <property id="attr-radio" _name="Data column" save="False" default="-1" custom-layout="True">
+        <property id="attr-radio" _name="Radio column" save="False" default="-1" custom-layout="True">
 	  <parameter-spec>
 	    <type>GParamInt</type>
 	    <min>-1</min>



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