Re: [Java-gnome-developer] ProgressBar
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2008-02-27 06:59:30
|
On Tue, 2008-02-26 at 11:09 +0100, Alfonso wrote: > - One is the pulse method, to activate the progressbar. ProgressBar has setFraction(), but you're right. No one has exposed pulse() as yet. Perhaps you'd like to contribute that and the attendant documentation? See HACKING. > - On the other side, to make the progressbar update while doing other > work java-gnome is thread safe. Do your "other work" in a worker thread, and make the calls to update your ProgressBar from there. So long as the main loop is running [ie, a thread has called Gtk.main()] things will work right. If you grab the source code, you'll see tests/prototype/WorkerThreads.java. That's not a tutorial, as such, but if you have a read of that you should get the idea. It's the program that was used in the testing discussed in the second link below. [Hm. We should move that to doc/examples/ one of these days] You can find discussion of the theory that led up to our thread safety design at http://research.operationaldynamics.com/blogs/andrew/software/gnome-desktop/gtk-thread-awareness.html (part 1) and then http://research.operationaldynamics.com/blogs/andrew/software/java-gnome/thread-safety-for-java.html (part 2). There is mention of the GDK lock at http://java-gnome.sourceforge.net/4.0/doc/api/org/gnome/gdk/Gdk.html AfC Sydney -- Andrew Frederick Cowie Operational Dynamics is an operations and engineering consultancy focusing on IT strategy, organizational architecture, systems review, and effective procedures for change management. We actively carry out research and development in these areas on behalf of our clients, and enable successful use of open source in their mission critical enterprises, worldwide. http://www.operationaldynamics.com/ Sydney New York Toronto London |