Re: Moving a window on the screen

2014-11-12 Thread Terry Reedy
On 11/8/2014 3:31 PM, Akira Li wrote: Terry Reedy writes: On my Win7 machine, your complicated code is much worse as it causes the window to jump about every half second After cutting and pasting again, I do not see the jumps. I do not have the code I ran before to compare. I do remember

Re: Moving a window on the screen

2014-11-08 Thread Akira Li
se just `root.after(period, call..)`: 34235 35236 36236 37236 38236 39237 40237 41237 42237 43238 44238 45238 46238 47239 48239 ... The start time drifts: >>> L[0], L[-1], L[0] + 1000*(len(L)-1) (34235, 206279, 206235) the difference between the expect

Re: Moving a window on the screen

2014-11-08 Thread Terry Reedy
On 11/8/2014 11:35 AM, Akira Li wrote: "ast" writes: 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() In general, to avoid the start t

Re: Moving a window on the screen

2014-11-08 Thread Akira Li
"ast" writes: > 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() In general, to avoid the start time "drift" [1], you

Re: Moving a window on the screen

2014-11-06 Thread Terry Reedy
On 11/6/2014 3:57 AM, Chris Angelico wrote: On Thu, Nov 6, 2014 at 7:32 PM, ast wrote: The fen window goes from it's initial location to the last one but we dont see all the intermediate steps You usually don't want to use time.sleep() in a GUI program. Try doing the same thing, but with an e

Re: Moving a window on the screen

2014-11-06 Thread ast
"Chris Angelico" a écrit dans le message de news:mailman.15536.1415264262.18130.python-l...@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

Re: Moving a window on the screen

2014-11-06 Thread Peter Otten
ast wrote: > Why the following program doesn't work ? > > for x in range(0, 100, 10): > fen.geometry("200x200+%d+10" % x) > time.sleep(0.5) > > > where fen is a window (fen = Tk()) > > The fen window goes from it's initial location to the last one > but we dont see all the intermed

Re: Moving a window on the screen

2014-11-06 Thread Chris Angelico
On Thu, Nov 6, 2014 at 7:32 PM, ast wrote: > The fen window goes from it's initial location to the last one > but we dont see all the intermediate steps 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 dis

Moving a window on the screen

2014-11-06 Thread ast
Hi Why the following program doesn't work ? for x in range(0, 100, 10): fen.geometry("200x200+%d+10" % x) time.sleep(0.5) where fen is a window (fen = Tk()) The fen window goes from it's initial location to the last one but we dont see all the intermediate steps thx -- https://m