Thread
:
Multitasking and GTK with python
View Single Post
omeriko9
2010-04-03 , 12:48
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#
6
Originally Posted by
McLightning
http://stackoverflow.com/questions/8...hile-true-loop
i found this but :/ i didnt get it
Queue handle multiple threads needs to run at the same time, without the need to take care of locking. If you are not familiar with the term 'lock' in the threads context, you might want to
read
about
that
- it's a fundamental part of threading.
Anyway, as you've being said earlier by maacruz, you need to verify that you call gtk.main() from the main thread only, and in the code example you posted, you are not doing that (run() is called by the child threads, therefore gtk.main() is being called by the child threads).
EDIT: to get the expected behavior from the code, replace "print" with the "gtk.main()", and take "gtk.main()" outside the any class or loop (place at the bottom after gui.start()).
EDIT2: There's really no difference between "for", "loop" and "while", all of them interpret to the same assembly calls, just with different handling for the conditions.
Last edited by omeriko9; 2010-04-03 at
13:04
.
Quote & Reply
|
The Following 2 Users Say Thank You to omeriko9 For This Useful Post:
McLightning
,
noobmonkey
omeriko9
View Public Profile
Send a private message to omeriko9
Find all posts by omeriko9