need help displaying One Word at a time...
Gary Kline
kline at thought.org
Tue Mar 4 12:16:29 PST 2008
Hi Guys,
Well, by trial/error, I'm learning.... what works and what doesn't;
and what's necessary and not. But I'm stuck wx. StaticText in a loop.
I've got a two-word file: "Hello, world" and want to disply each for a
fraction of a sec.
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
f = open("2w.txt", "r")
lines = f.readlines()
l1 = wx.StaticText(self, -1, "wx.TextCtrl")
for line in lines:
print "DEBUG: line = %s" % (line);
words = string.split(line)
for word in words:
print "DEBUG: word = %s" % (word);
t1 = wx.TextCtrl(self, -1, word);
time.sleep(0.99)
wx.CallAfter(t1.SetInsertionPoint, 0)
self.tc1 = t1
space = 4
sizer = wx.FlexGridSizer(cols=1, hgap=space, vgap=space)
sizer.AddMany([ l1, t1, (0,0), ])
border = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(border)
self.SetAutoLayout(True)
f.close()
I probably have some unnecessary code in here; but then this is my
first attempt at python+X11. I've googled and grep'd around to see
if there are any other wx python text function I could try. Thought
I'd ask the wizards first:)
thanks for any insights.
gary
--
Gary Kline kline at thought.org www.thought.org Public Service Unix
http://jottings.thought.org http://transfinite.thought.org
More information about the wxpython-users
mailing list