简体   繁体   English

wxPython-StyledTextCtrl获取当前可见的行

[英]wxPython - StyledTextCtrl get currently visible lines

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? 那么有没有办法获得当前可见的线条?

PS Or maybe there is another way to increase StyledTextCtrl's performance? PS或也许还有另一种方法可以提高StyledTextCtrl的性能? Thanks. 谢谢。

Use GetFirstVisibleLine() to determine the first visible line. 使用GetFirstVisibleLine()确定第一条可见线。 Lines are numbered starting at zero. 行从零开始编号。

Use LinesOnScreen() to determine how many lines are visible on the screen. 使用LinesOnScreen()确定在屏幕上可见多少行。

You can use GetLine(line) to get a string of an individual line. 您可以使用GetLine(line)获取单个行的字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM