From e95245f5f1c93016489f137060ad79e25487f51e Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Wed, 7 Aug 2013 16:03:06 +0200 Subject: GtkListBox support: Added action to add list box rows to a list box. --- plugins/gtk+/glade-gtk-list-box.c | 23 +++++++++++++++++++++-- plugins/gtk+/gtk+.xml.in | 6 ++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/plugins/gtk+/glade-gtk-list-box.c b/plugins/gtk+/glade-gtk-list-box.c index 8b056995..78c2c6c9 100644 --- a/plugins/gtk+/glade-gtk-list-box.c +++ b/plugins/gtk+/glade-gtk-list-box.c @@ -189,8 +189,6 @@ glade_gtk_listbox_add_verify (GladeWidgetAdaptor *adaptor, GtkWidget *child, gboolean user_feedback) { - g_return_if_fail (GTK_IS_LIST_BOX (container)); - if (!GTK_IS_LIST_BOX_ROW (child)) { if (user_feedback) @@ -270,6 +268,26 @@ glade_gtk_listbox_child_insert_action (GladeWidgetAdaptor *adaptor, glade_command_pop_group (); } +void +glade_gtk_listbox_action_activate (GladeWidgetAdaptor * adaptor, + GObject * object, + const gchar * action_path) +{ + if (strcmp (action_path, "add_row") == 0) + { + GladeWidgetAdaptor *adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_LIST_BOX_ROW); + GladeWidget *gparent = glade_widget_get_from_gobject (object); + GladeProject *project = glade_widget_get_project (gparent); + + glade_command_create (adaptor, gparent, NULL, project); + + glade_project_selection_set (project, object, TRUE); + } + else + GWA_GET_CLASS (GTK_TYPE_CONTAINER)->action_activate (adaptor, + object, action_path); +} + void glade_gtk_listbox_child_action_activate (GladeWidgetAdaptor *adaptor, GObject *container, @@ -296,3 +314,4 @@ glade_gtk_listbox_child_action_activate (GladeWidgetAdaptor *adaptor, action_path); } } + diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in index e0fb11b9..fbf656f4 100644 --- a/plugins/gtk+/gtk+.xml.in +++ b/plugins/gtk+/gtk+.xml.in @@ -1990,6 +1990,8 @@ range of values + + glade_gtk_listbox_action_activate glade_gtk_listbox_child_action_activate glade_gtk_create_fixed_widget glade_gtk_listbox_post_create @@ -1999,6 +2001,10 @@ range of values glade_gtk_listbox_set_child_property glade_gtk_listbox_get_child_property + + + + -- cgit v1.2.1