[gtk+] widget: Use a priv variable
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Use a priv variable
- Date: Sat, 26 Mar 2011 23:55:13 +0000 (UTC)
commit 29444cc30e4ed28d27465376a6f8ba44c0f7f4ec
Author: Benjamin Otte <otte redhat com>
Date: Sat Mar 26 21:45:32 2011 +0100
widget: Use a priv variable
gtk/gtkwidget.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index b81d8ff..4f67971 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7875,19 +7875,23 @@ gtk_widget_set_style (GtkWidget *widget,
void
gtk_widget_ensure_style (GtkWidget *widget)
{
+ GtkWidgetPrivate *priv;
+
g_return_if_fail (GTK_IS_WIDGET (widget));
- if (widget->priv->style == gtk_widget_get_default_style ())
+ priv = widget->priv;
+
+ if (priv->style == gtk_widget_get_default_style ())
{
GtkStyle *style;
- g_object_unref (widget->priv->style);
+ g_object_unref (priv->style);
style = g_object_new (GTK_TYPE_STYLE,
"context", gtk_widget_get_style_context (widget),
NULL);
- widget->priv->style = g_object_ref (style);
+ priv->style = g_object_ref (style);
g_signal_emit (widget,
widget_signals[STYLE_SET],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]