Tkinter event loop question

Fredrik Lundh fredrik at pythonware.com
Wed Aug 27 13:42:31 EDT 2008


gordon wrote:

> is it possible to send a message to the gui instance while the Tk
> event loop is running?I mean after i create a gui object like
> 
> root=Tk()
> mygui=SomeUI(root)
> 
> and call
> root.mainloop()
> 
> can i send message to mygui without quitting the ui or closing the
> window?i tried some code like
> mygui.someMethod()
> but it only gets executed after i close the the ui window.Is there a
> way to get this message passing while gui is running ?

it's the event loop that keeps Tkinter running, and Tkinter then calls 
your program (typically via command callbacks or event handlers) when 
it's time to do something.

so I guess the question here is from where you expect to call that 
method, and what you expect Tkinter to do when you call it...

</F>




More information about the Python-list mailing list