+static void
+copy_base_to_bg (GtkWidget *dest, GtkWidget *src)
+{
+ int i;
+ for (i = 0; i < 5; ++i)
+ {
+ GdkColor *col = >k_widget_get_style (src)->base[i];
+ gtk_widget_modify_bg (dest, i, col);
+
+ col = >k_widget_get_style (src)->text[i];
+ gtk_widget_modify_fg (dest, i, col);
+ }
+}
+
+static void
+on_dwgarea_realize (GtkWidget *dwg_area, gpointer data)
+{
+ GtkWidget *viewer = GTK_WIDGET (data);
+
+ copy_base_to_bg (dwg_area, viewer);
+}
+
+
+static void
+psppire_output_window_style_set (GtkWidget *w, GtkStyle *prev)
+{
+ GtkWidget *op = GTK_WIDGET (PSPPIRE_OUTPUT_WINDOW (w)->output);
+
+ /* Copy the base style from the parent widget to the container and
+ all its children.
+ We do this, because the container's primary purpose is to
+ display text. This way psppire appears to follow the chosen
+ gnome theme.
+ */
+ copy_base_to_bg (op, w);
+ gtk_container_foreach (GTK_CONTAINER (op), (GtkCallback) copy_base_to_bg,
+ PSPPIRE_OUTPUT_WINDOW (w)->output);
+
+ /* Chain up to the parent class */
+ GTK_WIDGET_CLASS (parent_class)->style_set (w, prev);
+}
+