Moving a window on the screen

ast nomail at invalid.com
Thu Nov 6 04:18:08 EST 2014


"Chris Angelico" <rosuav at gmail.com> a écrit dans le message de 
news:mailman.15536.1415264262.18130.python-list at python.org...

> You usually don't want to use time.sleep() in a GUI program. Try doing
> the same thing, but with an event loop delay call instead; often, the
> display won't update until you go back to the main loop.


Ok, thx, it works now with:

import tkinter
fen = tkinter.Tk()

x=0

def moveW():
    global x
    fen.geometry("200x200+%d+10"  %  x)
    x = x + 10
    if (x < 1200):
        fen.after(50, moveW)

moveW() 




More information about the Python-list mailing list