By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

Tkinter, main loop question.

P: n/a
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?

Nov 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Exod" <ra*******@gmail.comwrote:

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
Nov 23 '06 #2

P: n/a
Exod wrote:
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

--
BOFH excuse #394:

Jupiter is aligned with Mars.

Nov 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.