Editbox scrolls insertion point to bottom

I have a bit of an app where I translate text, and I do it in a large editbox, taking most of the height of the screen. I do it one paragraph at a time, typing the new one above the source paragraph. The trouble is that when I come to the end of the line and the word I type wraps into the next line, the whole text scrolls automatically so that the line into which I’m typing is now at the bottom - the source paragraph is invisible and I have to scroll it up. This becomes very tiresome after a while.

Now this is not pure wx that I’m using, it’s the Dabo framework… and I have a feeling I can fix this myself. I’m just asking where to start, where would the method I need to adjust (or perhaps a property) exactly be. Does this happen in pure wxPython too or is this where Dabo tried to help?

Not sure what do you mean by “editbox”, since there’s no such a thing in wxPython. On top of my mind I can’t think of any text widget with a behavior like the one you’re reporting… a little relevant code would help here. Anyway, perhaps you could just type your text below the source paragraph instead? You know, if nothing else works…

I’ve spent some time in the debugger with it and… well, it’s too complex to find, there are dozens of events which fire and I can’t find the one during which this happens. But at least I’ve found the class - it’s the wx.TextCtrl that Dabo’s dEditBox is based on. But then I can’t find where wx.TextCtrl is defined.

Found that this works:

		lnSS = self.SelectionStart
#...some more code in editbox.onKeyChar() here...

Though at times it jumps after my code inserts a bit of text here and there, no matter, this is much better than all the scrolling I had to do.
Thanks for listneing, you were a real Auntie Emma. Just looking for stuff to write here, I found this :).

wx.TextCtrl is basic wxPython, and it comes with some basic, normal behavior: try this:

import wx

class Main(wx.Frame):
    def __init__(self, *a, **k):
        wx.Frame.__init__(self, *a, **k)
        wx.TextCtrl(self, style=wx.TE_MULTILINE)
app = wx.App()

Now, there must be some more configuration available in your Dabo widget… if you have to manually realign after each keystroke… it seems pretty convoluted…

The keystroke check is there for different reasons, I’m checking for an underscore, in which cases I show a record picker to insert a bit of pseudo-link into the text. Now that the code is already there, it looked like a perfect place to put this. And mind you, the first line was already there… and I’ve found that the self.Focus() in the end was unnecessary, so I ended up with the same number of lines :).