Strange behaviour observed with Tkinter on PythonCE. I've attached a simple helloworld.py that demonstrates the behaviour.
This little app simply displays 'hello, world!' in a label. If you press the Update button, the text changes to 'goodbye, world.' using the config method. In real life, you might have a worker thread that is monitoring some process, and the GUI periodically updates itself. If I run this app on my desktop, it works as I expect. But when I run it on the PocketPC, what happens when I press the Update button is that the whole root window is duplicated, with the new text appearing in the new root window. The old root window can be found hiding underneath. Has anyone else noted this behaviour? If so, how do you work around it? thanks, -- Stewart Midwinter [EMAIL PROTECTED] [EMAIL PROTECTED]
import os OS = os.name.lower() if OS == 'ce': import pythonrc #contains the sys.path.append() commands from Tkinter import Tk, Label, Button import sys root = Tk() width = 240; height = 100 x = 0; y = 50 geometry = '%sx%s+%s+%s' % (width,height,x,y) root.wm_geometry(geometry) l = Label(root, text = 'hello, world!') l.pack() b = Button(root, text = 'quit', command = sys.exit) def up(): l.config(text='goodbye, world.') l.update() u = Button(root, text = 'update', command = up) b.pack() u.pack() root.mainloop()
_______________________________________________ PythonCE mailing list PythonCE@python.org http://mail.python.org/mailman/listinfo/pythonce