wxPython - StyledTextCtrl get currently visible lines

女生的网名这么多〃 提交于 2019-12-11 06:08:55

问题


I am still working on my text editor, and now I want to make it run faster. So I thought I may somehow get currently visible text, and parse it as I want. So is there a way to get currently visible lines?

P.S. Or maybe there is another way to increase StyledTextCtrl's performance? Thanks.


回答1:


Use GetFirstVisibleLine() to determine the first visible line. Lines are numbered starting at zero.

Use LinesOnScreen() to determine how many lines are visible on the screen.

You can use GetLine(line) to get a string of an individual line.



来源:https://stackoverflow.com/questions/19896965/wxpython-styledtextctrl-get-currently-visible-lines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!