X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-buttonbox.c;h=893e5f29a4639e64b17ee30a58628610760ec00d;hb=968830320f2eef1189803473970b31b7619c8d05;hp=24d82d27d3ac9a9b2e139cf2306880c98dd4bb81;hpb=f481fd69631024bcdc7dc2369bbc1592d7a43ac7;p=pspp diff --git a/src/ui/gui/psppire-buttonbox.c b/src/ui/gui/psppire-buttonbox.c index 24d82d27d3..893e5f29a4 100644 --- a/src/ui/gui/psppire-buttonbox.c +++ b/src/ui/gui/psppire-buttonbox.c @@ -406,8 +406,9 @@ psppire_button_box_init (PsppireButtonBox *bb) } -/* This function is lifted verbatim from the Gtk2.10.6 library */ - +/* This function was lifted verbatim from the Gtk2.10.6 library. + But later modified to fit Gtk2.24 + */ void _psppire_button_box_child_requisition (GtkWidget *widget, int *nvis_children, @@ -416,7 +417,6 @@ _psppire_button_box_child_requisition (GtkWidget *widget, int *height) { GtkButtonBox *bbox; - GtkBoxChild *child; GList *children; gint nchildren; gint nsecondaries; @@ -446,38 +446,39 @@ _psppire_button_box_child_requisition (GtkWidget *widget, "child-internal-pad-y", &ipad_y_default, NULL); - child_min_width = bbox->child_min_width != GTK_BUTTONBOX_DEFAULT - ? bbox->child_min_width : width_default; - child_min_height = bbox->child_min_height !=GTK_BUTTONBOX_DEFAULT - ? bbox->child_min_height : height_default; - ipad_x = bbox->child_ipad_x != GTK_BUTTONBOX_DEFAULT - ? bbox->child_ipad_x : ipad_x_default; - ipad_y = bbox->child_ipad_y != GTK_BUTTONBOX_DEFAULT - ? bbox->child_ipad_y : ipad_y_default; + child_min_width = width_default; + child_min_height = height_default; + ipad_x = ipad_x_default; + ipad_y = ipad_y_default; nchildren = 0; nsecondaries = 0; - children = GTK_BOX(bbox)->children; + needed_width = child_min_width; needed_height = child_min_height; ipad_w = ipad_x * 2; ipad_h = ipad_y * 2; + children = gtk_container_get_children (GTK_CONTAINER (bbox)); while (children) { - child = children->data; + GtkWidget *child = children->data; children = children->next; - if (gtk_widget_get_visible (child->widget)) + if (gtk_widget_get_visible (child)) { + gboolean is_secondary = FALSE; nchildren += 1; - gtk_widget_size_request (child->widget, &child_requisition); + gtk_widget_size_request (child, &child_requisition); if (child_requisition.width + ipad_w > needed_width) needed_width = child_requisition.width + ipad_w; if (child_requisition.height + ipad_h > needed_height) needed_height = child_requisition.height + ipad_h; - if (child->is_secondary) + + gtk_container_child_get (GTK_CONTAINER (bbox), child, "secondary", &is_secondary, NULL); + + if (is_secondary) nsecondaries++; } }