[wxPython-users] Re: text logging widget?

Tom Plunket python at fancy.org
Thu Dec 14 10:19:57 PST 2006


Josiah Carlson wrote:

> Grant Edwards <grante at visi.com> wrote:
> > Yea, I finally broke down and forced the cursor to the end each
> > time after adding any text.  That helps, but it causes a lot of
> > "flashing" and doesn't completely fix things.
> 
> The following should work, and limit flashing...
> 
> tc.Freeze()
> tc.AppendText(text)
> tc.Thaw()

This helps my flashing (or rather, "completely disappearing text"), but
not the scroll position.

> If not, toss in a tc.SetInsertionPointEnd() call before the Thaw.

This keeps the scroll position at the top of the window, for some
reason.  The cursor is at the end of the buffer, but the window won't
scroll.

It wasn't immediately apparent how I can manually control the scroll
position.  Is there a way?  The old behavior (prior to the addition of
Freeze/Thaw) was that the scroll position would end up beyond the end of
the text.

In some cases I'm appending a lot of text; it is catching stdout from
other processes, and some of those processes buffer their output (grr!),
so when they end, WHAM I get several Kb of text.

thx,
-tom!

-- 




More information about the wxpython-users mailing list