Avoid using Gtk features which are (soon to be) deprecated.
}
-/* 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,
int *height)
{
GtkButtonBox *bbox;
- GtkBoxChild *child;
GList *children;
gint nchildren;
gint nsecondaries;
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++;
}
}
{
GtkBox *base_box;
GtkButtonBox *box;
- GtkBoxChild *child;
GList *children;
GtkAllocation child_allocation;
gint nvis_children;
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_get_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;
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);
}
}
}
{
GtkBox *base_box;
GtkButtonBox *box;
- GtkBoxChild *child;
GList *children;
GtkAllocation child_allocation;
gint nvis_children;
x = allocation->x + (allocation->width - child_width) / 2;
childspace = child_height + 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_get_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.x = x;
- if (child->is_secondary)
+ if (is_secondary)
{
child_allocation.y = secondary_y;
secondary_y += childspace;
y += childspace;
}
- gtk_widget_size_allocate (child->widget, &child_allocation);
+ gtk_widget_size_allocate (child, &child_allocation);
}
}
}