View Single Post
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#6
Originally Posted by McLightning View Post
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.
 

The Following 2 Users Say Thank You to omeriko9 For This Useful Post: