Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80325

Re: Moving a window on the screen

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Moving a window on the screen
Date 2014-11-06 04:25 -0500
References <545b321a$0$2396$426a34cc@news.free.fr> <CAPTjJmrq4PME3Mf9JvirQ3wH1oi5cE-563yM+iJiWS102M6rCw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15538.1415265932.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 11/6/2014 3:57 AM, Chris Angelico wrote:
> On Thu, Nov 6, 2014 at 7:32 PM, ast <nomail@invalid.com> 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
> display won't update until you go back to the main loop.

import tkinter as tk
root = tk.Tk()

x = 0
def march():
     global x
     print(x)
     root.geometry("200x200+%d+%d" % (x,x))
     x += 10
     if x < 200:
         root.after(300, march)

march()
root.mainloop()

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Moving a window on the screen "ast" <nomail@invalid.com> - 2014-11-06 09:32 +0100
  Re: Moving a window on the screen Chris Angelico <rosuav@gmail.com> - 2014-11-06 19:57 +1100
    Re: Moving a window on the screen "ast" <nomail@invalid.com> - 2014-11-06 10:18 +0100
      Re: Moving a window on the screen Akira Li <4kir4.1i@gmail.com> - 2014-11-08 19:35 +0300
      Re: Moving a window on the screen Terry Reedy <tjreedy@udel.edu> - 2014-11-08 13:40 -0500
      Re: Moving a window on the screen Akira Li <4kir4.1i@gmail.com> - 2014-11-08 23:31 +0300
      Re: Moving a window on the screen Terry Reedy <tjreedy@udel.edu> - 2014-11-12 15:06 -0500
  Re: Moving a window on the screen Peter Otten <__peter__@web.de> - 2014-11-06 10:15 +0100
  Re: Moving a window on the screen Terry Reedy <tjreedy@udel.edu> - 2014-11-06 04:25 -0500

csiph-web