X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-hbuttonbox.c;h=9ce34bb491e3de783550ef7b9ad74fae347c08fd;hb=e339b2ca72d77a076566856e9357781d49cd983c;hp=3332a354b93126d178b840dd9e05519555514446;hpb=6e22b03f96f0edbace5bce45abdc57e94cf6957c;p=pspp diff --git a/src/ui/gui/psppire-hbuttonbox.c b/src/ui/gui/psppire-hbuttonbox.c index 3332a354b9..9ce34bb491 100644 --- a/src/ui/gui/psppire-hbuttonbox.c +++ b/src/ui/gui/psppire-hbuttonbox.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation + Copyright (C) 2007, 2010, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,12 +19,9 @@ #include #include -#include #include "psppire-hbuttonbox.h" #include "psppire-dialog.h" -#include - #include #define _(msgid) gettext (msgid) @@ -165,7 +162,6 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget, { GtkBox *base_box; GtkButtonBox *box; - GtkBoxChild *child; GList *children; GtkAllocation child_allocation; gint nvis_children; @@ -239,25 +235,29 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget, y = allocation->y + (allocation->height - child_height) / 2; childspace = child_width + childspacing; - children = GTK_BOX (box)->children; + children = gtk_container_get_children (GTK_CONTAINER (box)); while (children) { - child = children->data; + GtkWidget *child = children->data; children = children->next; - if (GTK_WIDGET_VISIBLE (child->widget)) + if (gtk_widget_get_visible (child)) { + gboolean is_secondary = FALSE; + gtk_container_child_get (GTK_CONTAINER (box), child, "secondary", &is_secondary, NULL); + + child_allocation.width = child_width; child_allocation.height = child_height; child_allocation.y = y; - if (child->is_secondary) - { + if (is_secondary) + { child_allocation.x = secondary_x; secondary_x += childspace; } - else + else { child_allocation.x = x; x += childspace; @@ -266,7 +266,7 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget, if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) child_allocation.x = (allocation->x + allocation->width) - (child_allocation.x + child_width - allocation->x); - gtk_widget_size_allocate (child->widget, &child_allocation); + gtk_widget_size_allocate (child, &child_allocation); } } }