How do I get the scroll position / range from a wx.TextCtrl control in wxPython

前端 未结 2 1692
情话喂你
情话喂你 2021-01-27 04:50

I have a little logging app (written in wxPython) that receives data from a bit of kit we\'re developing, and I want to display the text in a scrolling window. As it stands I\'m

2条回答
  •  無奈伤痛
    2021-01-27 05:37

    I just tested a simple example (checking GetScrollPos(0) and GetScrollRange(0) in EVT_TEXT event handler for wx.TextCtrl) and it works fine for me - they return index of currently shown line and total number of lines, respectively.

    Maybe the problem is your wxPython version? I used:

    >>> import wx
    >>> wx.version()
    '2.8.9.1 (msw-unicode)'
    

提交回复
热议问题