how to get the maximum line of each line in stc?

how to get the maximum line of stc?
I want to use it in this code :

        self.SetScrollbar(wx.VERTICAL, 0, 0, stcMaxline)
        self.SetScrollbar(wx.HORIZONTAL, 0, 6, (?)) <-- this is my
concern!

for example, there is a text like this :

···

--------------------------
abcd

abcdefg

a
--------------------------

and I would like to get the count of 'abcdefg'

Wonjun, Choi

maxlen = 0
for lineno in range(0,stc.GetLineCount()):
    line = stc.GetLine(lineno)
    maxlen = max(maxlen, line.Len())

should do the trick!

Gadget/Steve

···

On 14/10/2011 9:57 AM, Wonjun, Choi wrote:

how to get the maximum line of stc?
I want to use it in this code :

        self.SetScrollbar(wx.VERTICAL, 0, 0, stcMaxline)
        self.SetScrollbar(wx.HORIZONTAL, 0, 6, (?)) <-- this is my
concern!

for example, there is a text like this :
--------------------------
abcd

abcdefg

a
--------------------------

and I would like to get the count of 'abcdefg'

Wonjun, Choi

Thank you for your Tip!

···

2011/10/14 Gadget/Steve GadgetSteve@live.co.uk

On 14/10/2011 9:57 AM, Wonjun, Choi wrote:

how to get the maximum line of stc?

I want to use it in this code :

    self.SetScrollbar(wx.VERTICAL, 0, 0, stcMaxline)
    self.SetScrollbar(wx.HORIZONTAL, 0, 6, (?)) <-- this is my

concern!

for example, there is a text like this :


abcd

abcdefg

a


and I would like to get the count of ‘abcdefg’

Wonjun, Choi

maxlen = 0

for lineno in range(0,stc.GetLineCount()):

line = stc.GetLine(lineno)

maxlen = max(maxlen, line.Len())

should do the trick!

Gadget/Steve

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en