STC scroll problem

We are using the Py Shell with an additional STC option SetEndAtLastLine() to keep the last line of the text visible at the bottom of the window pane. Usually, STC option SetWrapMode() is set to True, the default setting in the Py Shell.

In general, things work pretty well with one, rather annoying exception. If we paste a long text string (without whitespaces, like a file name path), the text is wrapped as expected but the window is not scrolled up sufficiently to show the entire text. Only the top half of the first line is displayed but the remaining part of the text is not visible.

However, the window pane is scrolled correctly when typing a long text string. One difference is that in the latter case each text character is added individually using STC method AddText(), while in the case of paste, the entire text string is added with a single AddText() call.

We have tried to force scrolling the window pane up using STC methods ScrollToLine(), LineScroll() and EnsureCaretVisibile() but none of these have any effect.

The question is, is there another way to scroll the window pane? The vertical scroll bar does indicate that the window is not scroll up entirely.

/Jean Brouwers

Well ... we just found out that using

  wx.CallAfter(self.EnsureCaretVisible)

does scroll the window to keep the caret visible after text has been added.

/Jean Brouwers
ProphICy Semiconductor, Inc.

Jean Brouwers wrote:

ยทยทยท

We are using the Py Shell with an additional STC option SetEndAtLastLine() to keep the last line of the text visible at the bottom of the window pane. Usually, STC option SetWrapMode() is set to True, the default setting in the Py Shell.

In general, things work pretty well with one, rather annoying exception. If we paste a long text string (without whitespaces, like a file name path), the text is wrapped as expected but the window is not scrolled up sufficiently to show the entire text. Only the top half of the first line is displayed but the remaining part of the text is not visible. However, the window pane is scrolled correctly when typing a long text string. One difference is that in the latter case each text character is added individually using STC method AddText(), while in the case of paste, the entire text string is added with a single AddText() call.
We have tried to force scrolling the window pane up using STC methods ScrollToLine(), LineScroll() and EnsureCaretVisibile() but none of these have any effect.

The question is, is there another way to scroll the window pane? The vertical scroll bar does indicate that the window is not scroll up entirely.

/Jean Brouwers

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