[baobab/wip/vala: 38/44] Set the chart background during realize.



commit 67949303bbd83b84fb7c6c0adf51899e7fdc934b
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Jan 6 14:18:44 2012 +0100

    Set the chart background during realize.
    
    It is needed to get the right background for a chart that is initially
    hidden.

 src/baobab-chart.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/baobab-chart.c b/src/baobab-chart.c
index 3dd065c..e3da649 100644
--- a/src/baobab-chart.c
+++ b/src/baobab-chart.c
@@ -270,6 +270,7 @@ baobab_chart_realize (GtkWidget *widget)
   gint attributes_mask;
   GtkAllocation allocation;
   GdkWindow *window;
+  GtkStyleContext *context;
 
   g_return_if_fail (BAOBAB_IS_CHART (widget));
 
@@ -295,6 +296,9 @@ baobab_chart_realize (GtkWidget *widget)
   gtk_widget_set_window (widget, window);
   gdk_window_set_user_data (window, chart);
 
+  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_set_background (context, window);
+
   gtk_widget_add_events (widget,
                          GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK |
                          GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]