Re: [gtk-list] Re: scrolling question.



OK, the way I would handle this is to write a wrapper around the GTK text
box. I'm going to assume that your data flow has something like a poisson
distribution, so make an N line buffer. Use one of those nice gtk main
loop gimmicks demonstrated in testgtk.c to call your function every so
often, which will cause the function to add one line to the text box. And
then when your program wants to output, it calls a linebuffer function
that adds it to the bottom of the linebuffer. And then when your buffer
gets full, you can either output as much as is necessary to make space for
the new data, or block input, I'd write it externally. AFAIK there's no
way to do something like this with GTK itself, except using a timed
function. A GTK Timeout, but I haven't played with them.

Of course you could also dynamically allocate your linebuffer, but I tend
to avoid that because some user always comes along and hacks it or
overflows something or hoses RAM.

--
S.
GM/CS/MU -d+ H+>++ s+: !g p2 au0 !a w+++ v-(---) C++++$ UL++++$ UB+
US++ UI+++$ P+>++++ L++++$ 3+ E--- N+ K !W(-----) M+(-) !V -po+ Y+ t+
5++ !j !R G' !tv b+++ D++ B--- e+ u+* h++ f? r-- n---- y?


On Tue, 5 May 1998, Sergei Naumov wrote:

> 
> > Smart VT terminals? What are they?
> 
> Dumb terminals like VT240, VT330. Have you ever seen them? They have a
> controlled scrolling speed.
> 
> > IMHO, a computer's job is to do the user's job as fast and as efficiently
> > as possible, though, and not mess around in between.
> 
> I think you miss the point. I am not making things work after MSIE. :-)
> But, what I am trying to do is this. Suppose you have a long text and you
> are displaying it in the window. With a regular scrolling the text block
> will scroll upward in a second. What I want is that it flows slowly, so I
> have time to read through it. But it still should flow because I do not
> want to touch the keyboard or mouse to move it.
> 
> So, what I basically want is a stock-prices-ticker-like capabilities. On
> the ticker it does the horizontal scroll, but I want a vertical one.
> 
> The reason I need it is the following. I have a process that is constantly
> running. I want the results of this process to be displayed in a window
> but slowly enough that I can see it.
> 
> 	Sergei
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 



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