Author: kelnos Date: 2008-06-05 07:10:40 +0000 (Thu, 05 Jun 2008) New Revision: 27035
Modified: libxfcegui4/trunk/ChangeLog libxfcegui4/trunk/glade/libglade-xfce4.c Log: override build_children for XfceTitledDialog so button reponses and signals get set properly Modified: libxfcegui4/trunk/ChangeLog =================================================================== --- libxfcegui4/trunk/ChangeLog 2008-06-05 07:10:27 UTC (rev 27034) +++ libxfcegui4/trunk/ChangeLog 2008-06-05 07:10:40 UTC (rev 27035) @@ -1,5 +1,10 @@ 2008-06-05 Brian Tarricone <[EMAIL PROTECTED]> + * glade/libglade-xfce4.c: override build_children for XfceTitledDialog + so button reponses and signals get set properly + +2008-06-05 Brian Tarricone <[EMAIL PROTECTED]> + * autogen.sh: use git-svn to get revision number 2008-06-04 Brian Tarricone <[EMAIL PROTECTED]> Modified: libxfcegui4/trunk/glade/libglade-xfce4.c =================================================================== --- libxfcegui4/trunk/glade/libglade-xfce4.c 2008-06-05 07:10:27 UTC (rev 27034) +++ libxfcegui4/trunk/glade/libglade-xfce4.c 2008-06-05 07:10:40 UTC (rev 27035) @@ -33,6 +33,41 @@ #include <libxfcegui4/libxfcegui4.h> +static void +titled_dialog_build_children(GladeXML *xml, + GtkWidget *widget, + GladeWidgetInfo *info) +{ + GList *children, *l; + GtkContainer *action_area; + + glade_standard_build_children(xml, widget, info); + + action_area = GTK_CONTAINER(GTK_DIALOG(widget)->action_area); + if(!action_area) + return; + + /* we have to repack all the widgets in the action area so they get + * their response ids set properly, and so they actually emit the + * response signal when activated */ + + children = gtk_container_get_children(action_area); + for(l = children; l; l = l->next) { + g_object_ref(G_OBJECT(l->data)); + gtk_container_remove(action_area, GTK_WIDGET(l->data)); + } + + for(l = children; l; l = l->next) { + g_debug("adding button: %s", gtk_button_get_label(GTK_BUTTON(l->data))); + gtk_dialog_add_action_widget(GTK_DIALOG(widget), GTK_WIDGET(l->data), + GPOINTER_TO_INT(g_object_steal_data(G_OBJECT(l->data), + "response_id"))); + g_object_unref(G_OBJECT(l->data)); + } + + g_list_free(children); +} + static GtkWidget * titled_dialog_find_internal_child(GladeXML *xml, GtkWidget *parent, @@ -52,8 +87,8 @@ glade_register_widget(XFCE_TYPE_APP_MENU_ITEM, NULL, NULL, NULL); glade_register_widget(XFCE_TYPE_HEADING, NULL, NULL, NULL); glade_register_widget(XFCE_TYPE_SCALED_IMAGE, NULL, NULL, NULL); - glade_register_widget(XFCE_TYPE_TITLED_DIALOG, glade_standard_build_widget, - glade_standard_build_children, + glade_register_widget(XFCE_TYPE_TITLED_DIALOG, NULL, + titled_dialog_build_children, titled_dialog_find_internal_child); glade_provide("xfce4"); _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits