I count lines in python for a text like this:
count = 0
for ch in text:
if( ch == "\n" ):
count += 1
return count
The same text goes into a textBox control.
I would like to scroll to the last line but the line count does not help , because the textBox wraps long lines making them 2 or more lines.
I can go to the last line by scrolling to -1
, but then I cannot scroll up anymore. I need to know the (actual) max line count so I can scroll to any position i want.
lastLine = self.count_lines( text )
self.getControl( 100 ).setText( text )
self.getControl( 100 ).scroll( lastLine )