pspp-dev
[Top][All Lists]
Advanced

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

Re: check out the GUI output


From: Ben Pfaff
Subject: Re: check out the GUI output
Date: Sat, 20 Jun 2009 21:31:30 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

John Darrington <address@hidden> writes:

> On Sat, Jun 20, 2009 at 10:04:23AM -0700, Ben Pfaff wrote:
>      
>      At a minimum, I'm going to change the background color to white.
>
> It's a minor detail, but I think it would be better to set the background
> and foreground colours from the style of he widget upon which it's drawn.

I think I came up with an acceptable way to do that with this
commit:

commit f3aed988c27ca4a37a5f5102c18012c3983a7191
Author: Ben Pfaff <address@hidden>
Date:   Sat Jun 20 21:30:57 2009 -0700

    output: Use "base" color for background in GUI output window.
    
    The "base" color in GtkStyle is used as the background color for GTK+
    widgets that display editable text, e.g. GtkEntry.  That's what we're
    aiming for, eventually, with the PSPP GUI output, and the default
    white "base" color looks better than the default gray background
    color, so use it.

diff --git a/src/ui/gui/psppire-output-window.c 
b/src/ui/gui/psppire-output-window.c
index f2f0ca2..06692c2 100644
--- a/src/ui/gui/psppire-output-window.c
+++ b/src/ui/gui/psppire-output-window.c
@@ -165,6 +165,8 @@ psppire_output_submit (struct outp_driver *this, struct 
som_entity *entity)
       entity->class->area (rendering, &tw, &th);
 
       drawing_area = gtk_drawing_area_new ();
+      gtk_widget_modify_bg (GTK_WIDGET (drawing_area), GTK_STATE_NORMAL,
+                            &gtk_widget_get_style 
(drawing_area)->base[GTK_STATE_NORMAL]);
       g_object_set_data (G_OBJECT (drawing_area),
                          "entity", xmemdup (entity, sizeof *entity));
       gtk_widget_set_size_request (drawing_area, tw / 1024, th / 1024);
@@ -249,6 +251,9 @@ psppire_output_window_init (PsppireOutputWindow *window)
   window->output = GTK_LAYOUT (get_widget_assert (xml, "output"));
   window->y = 0;
 
+  gtk_widget_modify_bg (GTK_WIDGET (window->output), GTK_STATE_NORMAL,
+                        &gtk_widget_get_style (GTK_WIDGET 
(window->output))->base[GTK_STATE_NORMAL]);
+
   connect_help (xml);
 
   g_signal_connect (window,

-- 
Ben Pfaff 
http://benpfaff.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]