Updating A Tkinter Window every 100 ms?

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Wed Nov 20 03:23:05 EST 2002


On Wed, 2002-11-20 at 00:29, Josiah wrote:
> I would like to create the TK dialog with a "Update" function that
> will run every 100 ms. A self calling function. Inside this fuction, I
> want to call "lift()" to keep the window on top of all the others, and
> I want to call another function that will update other things.
>  Could some look at my sample code and please give me some feedback?
> Is there a better way? Why does the "lift()" function not work with
> "self.master.lift()"?
> 
> Thanks for any help with this.
> Josiah
> 
> 
> ##############################################################
> from Tkinter import *
> 
> class App:
>  def __init__(self, master):
>    frame = Frame(master) 
>    frame.grid()
> 
>  def Do_Stuff(self):
>    pass 
> 
>  def Update(self):
>    self.Do_Stuff() 
>    root.lift() 

try tkraise() here on root, it seems to work on my Linux box it may not
work on all platforms)

I have to ask why... 


>    root.after(100, self.Update)
> 
> root = Tk()
> app = App(root)
> app.Update()
> root.mainloop()
> ###############################################################
> -- 
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list