TextCtrl scrolling

Hi,

I have a readonly wx.TextCtrl into which I append text
from time to time (log) and when the text height is
bigger than the height of the control I would like to
scroll so the last line would be visible. Currently
I'm using self.ShowPosition(self.GetLastPosition())
and indeed scrolls to the last line, but the last line
remains the only visible line - it is repositioned to
the top of the control.
Is there a "standard" way to scroll to the end so the
last line of text inserted is visisble AND is
displayed at the bottom of the control? Or I should go
custom?

Thanks,
Sorin

···

__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861

Hello,

You might want to use TextCtrl::ScrollPages instead:

  wx.EVT_TEXT(text_ctrl, text_ctrl.GetId(), OnText)

    def OnText(self, event):
        #text_ctrl.ShowPosition(text_ctrl.GetLastPosition())
        text_ctrl.ScrollPages(1)

···

-----Original Message-----
From: Sorin C. [mailto:soso_pub@yahoo.com]
Sent: Thursday, May 13, 2004 10:03 PM
To: wxpython-users@lists.wxwidgets.org
Subject: [wxPython-users] TextCtrl scrolling

Hi,

I have a readonly wx.TextCtrl into which I append text
from time to time (log) and when the text height is
bigger than the height of the control I would like to
scroll so the last line would be visible. Currently
I'm using self.ShowPosition(self.GetLastPosition())
and indeed scrolls to the last line, but the last line
remains the only visible line - it is repositioned to
the top of the control.
Is there a "standard" way to scroll to the end so the
last line of text inserted is visisble AND is
displayed at the bottom of the control? Or I should go
custom?

Thanks,
Sorin

__________________________________
Do you Yahoo!?
Yahoo! Movies - Buy advance tickets for 'Shrek 2'
http://movies.yahoo.com/showtimes/movie?mid=1808405861

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Is there a "standard" way to scroll to the end so the
last line of text inserted is visisble AND is
displayed at the bottom of the control?

After calling AppendText, call ScrollLines(-1)

Roger