Operate only on the visible lines in a text window

Liste des GroupesRevenir à cl tcl 
Sujet : Operate only on the visible lines in a text window
De : sdeacon (at) *nospam* us.socionext.com (Shaun Deacon)
Groupes : comp.lang.tcl
Date : 10. Jul 2024, 01:57:17
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6kmal$1jhpc$1@dont-email.me>
User-Agent : Mozilla/5.0 (Windows NT 10.0; WOW64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.2
My application uses a text widget to display chip 'test vectors' from a loaded file. Each vector occupies a line - for example :
0011010XXLLLHH
0100110XXLHHLH
...
0110110XXHHHHH
A highlighting operation colors specified values (for example all 1's) for all lines of text in the widget. For small and medium sized files this is fine. However, test files can often be large (over 500,000 vectors). The highlight operation applied to all lines is too slow in this case - the vectors are much longer strings in real life too.
The obvious solution to me is to just highlight the currently visible lines (or a range of lines spanning the current view - say 1000 or so) and when the user scrolls the window, highlight the new set of lines.
Suggestions on the best way to find the indexes for the currently visible lines when the widget has been scrolled would be great.
Can someone please point me in the right direction ?
For some reason, I can't seem to find what I'm looking for in CLT, the wiki or the man pages.
thanks
Shaun

Date Sujet#  Auteur
10 Jul 24 * Operate only on the visible lines in a text window5Shaun Deacon
10 Jul 24 +- Re: Operate only on the visible lines in a text window1et99
10 Jul 24 +- Operate only on the visible lines in a text window1clt.to.davebr
10 Jul 24 `* Re: Operate only on the visible lines in a text window2Ralf Fassel
10 Jul 24  `- Re: Operate only on the visible lines in a text window1Shaun Deacon

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal