[Java-gnome-developer] Busy loops
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2004-10-12 15:02:16
|
I'm writing something that is mostly doing a lot of hard work in the background; the GUI is just there to report status. Obviously I'm going to be updating a Gtk.ProgressBar as I go. The question I have is how best to structure such a program? Event driven programs, of course, get kicked off when Gtk.main() gets called, at which point you "loose" the conventional thread of execution. Should I be starting a new thread, just before the call to start the main loop, to do all the work, and then just update the ProgressBar and Labels as necessary from there? In fact, other than someone hitting "Cancel" there are no [user] events that I'm expecting. For some reason Gtk.mainIteration() comes to mind, but I'm not sure how that fits in with main()'s loop. Any pointers? [Either java-gnome or GTK best-practice or...] AfC Sydney --=20 Andrew Frederick Cowie OPERATIONAL DYNAMICS Operations Consultants and Infrastructure Engineers http://www.operationaldynamics.com/ |