I use the TextCtrl to display log output from a long-running process, and call AppendText() as needed to add new lines as my GUI receives them. A senior colleague complained that this causes the control to jump to the end, which makes it difficult to inspect a static section of text. Is there a simple way to avoid this? (I think he’s using a Mac, if it matters.)
Not with TextCtrl. It seems like somebody else was working on this problem recently, not sure if it was here or in the IRC channel. I think they ended up making a custom control for displaying log messages so they could control scrolling.
···
On 5/5/10 4:07 PM, Nathaniel Echols wrote:
I use the TextCtrl to display log output from a long-running process,
and call AppendText() as needed to add new lines as my GUI receives
them. A senior colleague complained that this causes the control to
jump to the end, which makes it difficult to inspect a static section of
text. Is there a simple way to avoid this? (I think he's using a Mac,
if it matters.)
I remember someone talking about this too...last week or the week
before. It sounded like they were going to write a custom widget, so I
told them to contribute it back when it was done. I haven't heard
anything since.
If you figure it out Nathaniel, be sure to drop us a line.
···
On May 6, 12:10 pm, Robin Dunn <ro...@alldunn.com> wrote:
On 5/5/10 4:07 PM, Nathaniel Echols wrote:
> I use the TextCtrl to display log output from a long-running process,
> and call AppendText() as needed to add new lines as my GUI receives
> them. A senior colleague complained that this causes the control to
> jump to the end, which makes it difficult to inspect a static section of
> text. Is there a simple way to avoid this? (I think he's using a Mac,
> if it matters.)
Not with TextCtrl. It seems like somebody else was working on this
problem recently, not sure if it was here or in the IRC channel. I
think they ended up making a custom control for displaying log messages
so they could control scrolling.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org
Does that work for you? What I find works best is to determine if the
view is currently at the bottom. If it is, do the automatic scrolling.
If not (meaning the user has scrolled up to look at something) , don't
do the automatic scrolling.
···
On Wed, May 5, 2010 at 6:07 PM, Nathaniel Echols <nathaniel.echols@gmail.com> wrote:
I use the TextCtrl to display log output from a long-running process, and
call AppendText() as needed to add new lines as my GUI receives them. A
senior colleague complained that this causes the control to jump to the end,
which makes it difficult to inspect a static section of text. Is there a
simple way to avoid this? (I think he's using a Mac, if it matters.)
thanks,
Nat
i accidentally discovered a potential way to do this on windows, ymmv
for mac. I was trying to solve the problem of too much logging into a
"debug" window slowing down my app, so i tried freezing (rightly or
wrongly, probably wrongly) the parent of the text control, i.e.
this had the unintended side effect of scroll bar no longer moving to
the end after the append is done. You may be able to kludge that
together with detecting the user moving the scroll bar or find some
other way using this info.
regards,
-jeff
···
On May 7, 4:38 am, Bryan Oakley <bryan.oak...@gmail.com> wrote:
On Wed, May 5, 2010 at 6:07 PM, Nathaniel Echols > > <nathaniel.ech...@gmail.com> wrote:
> I use the TextCtrl to display log output from a long-running process, and
> call AppendText() as needed to add new lines as my GUI receives them. A
> senior colleague complained that this causes the control to jump to the end,
> which makes it difficult to inspect a static section of text. Is there a
> simple way to avoid this? (I think he's using a Mac, if it matters.)
> thanks,
> Nat
I am also using the TestCtrl,When ever object is updating.Every time vertical scroll bar is going down.I attached the demo script.Please share the answer.