Tkinter, main loop question.

E

Exod

Don't know if its possible in this light-weight GUI toolset, but can i
somehow hook up into the mainloop in it, for example if i were to
create an internet application, i would need to keep recieving data
from within it?
 
H

Hendrik van Rooyen

Don't know if its possible in this light-weight GUI toolset, but can i
somehow hook up into the mainloop in it, for example if i were to
create an internet application, i would need to keep recieving data
from within it?

Its possible - use the call back mechanism to implement a ticker or stutter
thread, remembering that you cant block here, because then the gui stops.

If its a good idea is another question, because sockets wants to be the main
thread too.

but if you fire up another process for the comms, and use threads in front of
pipes, with queues to the ticker in the main loop, it works. Just don't call any
gui stuff from threads in the same process, only from the ticker or stutter
thread.

- Hendrik
 
B

Bjoern Schliessmann

Exod said:
Don't know if its possible in this light-weight GUI toolset, but
can i somehow hook up into the mainloop in it, for example if i
were to create an internet application, i would need to keep
recieving data from within it?

That's something where you could try the Twisted framework
(http://twistedmatrix.com). Its event loop integrates with many GUI
toolkits', also Tk's.

Regards,


Björn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top