summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2010-06-02 06:28:22 +0200
committerJavier Jardón <jjardon@gnome.org>2010-07-13 19:40:46 +0200
commit3a10216dd01c8d10df235b88c8942b2fda15689b (patch)
tree80df10196e365741a9dcb6a8c773c1e992e3e9fe /demos
parent009acc263e883923fd7c528c401f9d39756788aa (diff)
downloadgtk+-3a10216dd01c8d10df235b88c8942b2fda15689b.tar.gz
Use accessor functions to acces GtkContainer
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/offscreen_window.c14
-rw-r--r--demos/gtk-demo/offscreen_window2.c15
2 files changed, 17 insertions, 12 deletions
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index 6ff212f5b0..9a7477667d 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -226,12 +226,12 @@ gtk_rotated_bin_realize (GtkWidget *widget)
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
+ guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
@@ -378,6 +378,7 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
GtkRequisition child_requisition;
double s, c;
double w, h;
+ guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
@@ -390,8 +391,9 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height;
- requisition->width = GTK_CONTAINER (widget)->border_width * 2 + w;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2 + h;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = border_width * 2 + w;
+ requisition->height = border_width * 2 + h;
}
static void
@@ -399,13 +401,13 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
- gint border_width;
+ guint border_width;
gint w, h;
gdouble s, c;
widget->allocation = *allocation;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index 3ee3630d03..1c9b08479f 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -164,12 +164,12 @@ gtk_mirror_bin_realize (GtkWidget *widget)
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
+ guint border_width;
GtkRequisition child_requisition;
gtk_widget_set_realized (widget, TRUE);
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
@@ -302,6 +302,7 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
GtkRequisition child_requisition;
+ guint border_width;
child_requisition.width = 0;
child_requisition.height = 0;
@@ -309,8 +310,9 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
if (bin->child && gtk_widget_get_visible (bin->child))
gtk_widget_size_request (bin->child, &child_requisition);
- requisition->width = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.width + 10;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2 + child_requisition.height * 2 + 10;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = border_width * 2 + child_requisition.width + 10;
+ requisition->height = border_width * 2 + child_requisition.height * 2 + 10;
}
static void
@@ -318,11 +320,12 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
- gint border_width;
gint w, h;
+ guint border_width;
+
widget->allocation = *allocation;
- border_width = GTK_CONTAINER (widget)->border_width;
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
w = allocation->width - border_width * 2;
h = allocation->height - border_width * 2;