[gtk+/gtk-3-0] widget: Use a priv variable
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-0] widget: Use a priv variable
- Date: Sun, 27 Mar 2011 00:17:14 +0000 (UTC)
commit ac43de26c6a598b4e440affc3db27bf9d1aaf26f
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 b3a776c..b0aaac0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7876,19 +7876,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]