summaryrefslogtreecommitdiff
path: root/gtk/gtkframe.c
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-05-24 22:31:36 +0200
committerJavier Jardón <jjardon@gnome.org>2010-07-13 19:40:47 +0200
commit4427760bcc330f60ec5778be04274f9f8073a84d (patch)
tree3ffb76a88d357ea094b1287b1fcfdfe078271f90 /gtk/gtkframe.c
parent2de1f3f88c661f2b932f9ab36a3b22ca35df1635 (diff)
downloadgtk+-4427760bcc330f60ec5778be04274f9f8073a84d.tar.gz
Use GtkBin accessors
Diffstat (limited to 'gtk/gtkframe.c')
-rw-r--r--gtk/gtkframe.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index cb8ddd2b1b..f5474ed10b 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -302,9 +302,11 @@ gtk_frame_forall (GtkContainer *container,
{
GtkBin *bin = GTK_BIN (container);
GtkFrame *frame = GTK_FRAME (container);
+ GtkWidget *child;
- if (bin->child)
- (* callback) (bin->child, callback_data);
+ child = gtk_bin_get_child (bin);
+ if (child)
+ (* callback) (child, callback_data);
if (frame->label_widget)
(* callback) (frame->label_widget, callback_data);
@@ -615,6 +617,7 @@ gtk_frame_size_allocate (GtkWidget *widget,
GtkFrame *frame = GTK_FRAME (widget);
GtkBin *bin = GTK_BIN (widget);
GtkAllocation new_allocation;
+ GtkWidget *child;
widget->allocation = *allocation;
@@ -633,9 +636,10 @@ gtk_frame_size_allocate (GtkWidget *widget,
#endif
)
gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE);
-
- if (bin->child && gtk_widget_get_visible (bin->child))
- gtk_widget_size_allocate (bin->child, &new_allocation);
+
+ child = gtk_bin_get_child (bin);
+ if (child && gtk_widget_get_visible (child))
+ gtk_widget_size_allocate (child, &new_allocation);
frame->child_allocation = new_allocation;
@@ -712,6 +716,7 @@ gtk_frame_get_size (GtkSizeRequest *request,
gint *natural_size)
{
GtkWidget *widget = GTK_WIDGET (request);
+ GtkWidget *child;
GtkFrame *frame = GTK_FRAME (widget);
GtkBin *bin = GTK_BIN (widget);
gint child_min, child_nat;
@@ -741,18 +746,19 @@ gtk_frame_get_size (GtkSizeRequest *request,
natural = 0;
}
- if (bin->child && gtk_widget_get_visible (bin->child))
+ child = gtk_bin_get_child (bin);
+ if (child && gtk_widget_get_visible (child))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- gtk_size_request_get_width (GTK_SIZE_REQUEST (bin->child),
+ gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
&child_min, &child_nat);
minimum = MAX (minimum, child_min);
natural = MAX (natural, child_nat);
}
else
{
- gtk_size_request_get_height (GTK_SIZE_REQUEST (bin->child),
+ gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
&child_min, &child_nat);
minimum += child_min;
natural += child_nat;