wxPython-StyledTextCtrl获取当前可见的行 [英] wxPython - StyledTextCtrl get currently visible lines

查看:151
本文介绍了wxPython-StyledTextCtrl获取当前可见的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍在使用文本编辑器,现在我想使其运行更快.所以我想我可能会以某种方式获取当前可见的文本,并根据需要对其进行解析.那么有没有办法获得当前可见的线条?

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 .或者也许还有另一种方法来提高StyledTextCtrl的性能?谢谢.

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

推荐答案

使用GetFirstVisibleLine()确定第一条可见行.行从零开始编号.

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

使用LinesOnScreen()确定在屏幕上可见多少行.

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

您可以使用GetLine(line)获取单个行的字符串.

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

这篇关于wxPython-StyledTextCtrl获取当前可见的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆