summaryrefslogtreecommitdiff
path: root/gtk/gtkplug.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/gtkplug.c
parent2de1f3f88c661f2b932f9ab36a3b22ca35df1635 (diff)
downloadgtk+-4427760bcc330f60ec5778be04274f9f8073a84d.tar.gz
Use GtkBin accessors
Diffstat (limited to 'gtk/gtkplug.c')
-rw-r--r--gtk/gtkplug.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index 722fe8777f..5bb003afc0 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -705,13 +705,14 @@ gtk_plug_map (GtkWidget *widget)
{
GtkBin *bin = GTK_BIN (widget);
GtkPlug *plug = GTK_PLUG (widget);
+ GtkWidget *child;
gtk_widget_set_mapped (widget, TRUE);
- if (bin->child &&
- gtk_widget_get_visible (bin->child) &&
- !gtk_widget_get_mapped (bin->child))
- gtk_widget_map (bin->child);
+ child = gtk_bin_get_child (bin);
+ if (gtk_widget_get_visible (child) &&
+ !gtk_widget_get_mapped (child))
+ gtk_widget_map (child);
_gtk_plug_windowing_map_toplevel (plug);
@@ -748,6 +749,8 @@ static void
gtk_plug_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
+ GtkWidget *child;
+
if (gtk_widget_is_toplevel (widget))
GTK_WIDGET_CLASS (gtk_plug_parent_class)->size_allocate (widget, allocation);
else
@@ -761,7 +764,8 @@ gtk_plug_size_allocate (GtkWidget *widget,
allocation->x, allocation->y,
allocation->width, allocation->height);
- if (bin->child && gtk_widget_get_visible (bin->child))
+ child = gtk_bin_get_child (bin);
+ if (gtk_widget_get_visible (child))
{
GtkAllocation child_allocation;
@@ -771,7 +775,7 @@ gtk_plug_size_allocate (GtkWidget *widget,
child_allocation.height =
MAX (1, (gint)allocation->height - child_allocation.y * 2);
- gtk_widget_size_allocate (bin->child, &child_allocation);
+ gtk_widget_size_allocate (child, &child_allocation);
}
}
@@ -947,6 +951,7 @@ gtk_plug_focus (GtkWidget *widget,
GtkPlug *plug = GTK_PLUG (widget);
GtkWindow *window = GTK_WINDOW (widget);
GtkContainer *container = GTK_CONTAINER (widget);
+ GtkWidget *child;
GtkWidget *old_focus_child;
GtkWidget *parent;
@@ -974,7 +979,8 @@ gtk_plug_focus (GtkWidget *widget,
else
{
/* Try to focus the first widget in the window */
- if (bin->child && gtk_widget_child_focus (bin->child, direction))
+ child = gtk_bin_get_child (bin);
+ if (child && gtk_widget_child_focus (child, direction))
return TRUE;
}