[gtk+/refactor: 13/96] gtk/gtktoolbutton.c: use accessor functions to access GtkWidget
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor: 13/96] gtk/gtktoolbutton.c: use accessor functions to access GtkWidget
- Date: Thu, 12 Aug 2010 02:16:59 +0000 (UTC)
commit 66691aac781fc3658a4ce049f9a86ca782e80efc
Author: Javier Jardón <jjardon gnome org>
Date: Wed Aug 11 22:51:57 2010 +0200
gtk/gtktoolbutton.c: use accessor functions to access GtkWidget
gtk/gtktoolbutton.c | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index d0c8503..16be05c 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -323,6 +323,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
guint icon_spacing;
GtkOrientation text_orientation = GTK_ORIENTATION_HORIZONTAL;
GtkSizeGroup *size_group = NULL;
+ GtkWidget *parent;
button->priv->contents_invalid = FALSE;
@@ -330,15 +331,17 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
"icon-spacing", &icon_spacing,
NULL);
- if (button->priv->icon_widget && button->priv->icon_widget->parent)
+ parent = gtk_widget_get_parent (button->priv->icon_widget);
+ if (button->priv->icon_widget && parent)
{
- gtk_container_remove (GTK_CONTAINER (button->priv->icon_widget->parent),
+ gtk_container_remove (GTK_CONTAINER (parent),
button->priv->icon_widget);
}
- if (button->priv->label_widget && button->priv->label_widget->parent)
+ parent = gtk_widget_get_parent (button->priv->label_widget);
+ if (button->priv->label_widget && parent)
{
- gtk_container_remove (GTK_CONTAINER (button->priv->label_widget->parent),
+ gtk_container_remove (GTK_CONTAINER (parent),
button->priv->label_widget);
}
@@ -1193,9 +1196,12 @@ gtk_tool_button_set_icon_widget (GtkToolButton *button,
{
if (button->priv->icon_widget)
{
- if (button->priv->icon_widget->parent)
- gtk_container_remove (GTK_CONTAINER (button->priv->icon_widget->parent),
- button->priv->icon_widget);
+ GtkWidget *parent;
+
+ parent = gtk_widget_get_parent (button->priv->icon_widget);
+ if (parent)
+ gtk_container_remove (GTK_CONTAINER (parent),
+ button->priv->icon_widget);
g_object_unref (button->priv->icon_widget);
}
@@ -1234,10 +1240,13 @@ gtk_tool_button_set_label_widget (GtkToolButton *button,
{
if (button->priv->label_widget)
{
- if (button->priv->label_widget->parent)
- gtk_container_remove (GTK_CONTAINER (button->priv->label_widget->parent),
- button->priv->label_widget);
-
+ GtkWidget *parent;
+
+ parent = gtk_widget_get_parent (button->priv->label_widget);
+ if (parent)
+ gtk_container_remove (GTK_CONTAINER (parent),
+ button->priv->label_widget);
+
g_object_unref (button->priv->label_widget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]