I am using a TextCtrl to use as a log viewer in my application. When I am adding a single/multiple line text, the text is not visible because of scrolling two lines upwards. I have to manually adjust the scrollbar to view it. Here I am sure that I am not adding any spaces or empty line in the end of my text. How do I keep focus on the text that has been entered ?
The style that has been used for creating TextCtrl:
I am using a TextCtrl to use as a log viewer in my application. When I am adding a single/multiple line text, the text is not visible because of scrolling two lines upwards. I have to manually adjust the scrollbar to view it. Here I am sure that I am not adding any spaces or empty line in the end of my text. How do I keep focus on the text that has been entered ?
The style that has been used for creating TextCtrl:
It's hard to get the various native text widgets on the various platforms to work as desired in situations like this, because they each have their little quirks and behavioral differences. (One of these days I should just create a generic widget that is designed for displaying log messages and nothing else...) Anyway, I would experiment with using wx.TE_RICH (instead of RICH2), calling ShowPosition passing the position of the line a few lines above the last, etc. until you get what you want.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!