S
Sori Schwimmer
Eric Brunel is right in that a Listbox won't provide
any builtin help for this kind of things.
Suppose you can afford a width of 10 chars. Suppose
your lines are stored in the variable Lines - a
sequence. Suppose you use a font with fixed width (the
width occupied by "i" is the same like for "m").
lBox = Listbox(parent, width=10)
for i in Lines:
if len(i) > 10:
lBox.insert(END, i[-10:])
else:
lBox.insert(END, ('%10s' % i))
For more on string formatting, check chapter 2.3.6.2
in Python's documentation.
Good luck!
Sorin Schwimmer
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
any builtin help for this kind of things.
Suppose you can afford a width of 10 chars. Suppose
your lines are stored in the variable Lines - a
sequence. Suppose you use a font with fixed width (the
width occupied by "i" is the same like for "m").
lBox = Listbox(parent, width=10)
for i in Lines:
if len(i) > 10:
lBox.insert(END, i[-10:])
else:
lBox.insert(END, ('%10s' % i))
For more on string formatting, check chapter 2.3.6.2
in Python's documentation.
Good luck!
Sorin Schwimmer
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com