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 20:29:58 -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 08:14:57PM -0700, Ben Pfaff wrote:
>      John Darrington <address@hidden> writes:
>      
>      > On Fri, Jun 19, 2009 at 11:01:28PM -0700, Ben Pfaff wrote:
>      >      
>      >              It's quick and dirty and lacks many important features 
> (such as
>      >              scrolling, and not leaking memory)
>      >      
>      > Is scrolling not implemented for any fundamental reason, or just 
> because you
>      > haven't had the time to do it?
>      
>      I assumed that I would get it without having to do anything at
>      all, since GtkLayout "supports scrolling natively" according to
>      the documentation.  Probably I'm missing something simple.
>
> I think you just need to put a GtkViewport between the GtkScrolledWindow 
> and the GtkLayout.

The fix was simple:

commit 2a08758741107d4627549e87c6af9537cd403c1d
Author: Ben Pfaff <address@hidden>
Date:   Sat Jun 20 20:29:08 2009 -0700

    output: Make GUI output window scrollable.

diff --git a/src/ui/gui/psppire-output-window.c 
b/src/ui/gui/psppire-output-window.c
index 510d1c9..ea713c4 100644
--- a/src/ui/gui/psppire-output-window.c
+++ b/src/ui/gui/psppire-output-window.c
@@ -178,7 +178,12 @@ psppire_output_submit (struct outp_driver *this, struct 
som_entity *entity)
       driver->class->close_driver (driver);
       outp_free_driver (driver);
 
+      if (tw / 1024 > the_output_viewer->max_width)
+        the_output_viewer->max_width = tw / 1024;
       the_output_viewer->y += th / 1024;
+
+      gtk_layout_set_size (the_output_viewer->output,
+                           the_output_viewer->max_width, the_output_viewer->y);
     }
 
   gtk_window_set_urgency_hint (GTK_WINDOW (the_output_viewer), TRUE);
diff --git a/src/ui/gui/psppire-output-window.h 
b/src/ui/gui/psppire-output-window.h
index 7b62be2..5cb2528 100644
--- a/src/ui/gui/psppire-output-window.h
+++ b/src/ui/gui/psppire-output-window.h
@@ -52,6 +52,7 @@ struct _PsppireOutputWindow
 
   /* <private> */
   GtkLayout *output;
+  int max_width;
   int y;
 };
 

-- 
"Then, I came to my senses, and slunk away, hoping no one overheard my
 thinking."
--Steve McAndrewSmith in the Monastery




reply via email to

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