Thread: [Java-gnome-developer] ProgressBar
Brought to you by:
afcowie
From: Alfonso <eu...@ya...> - 2008-02-26 14:14:54
|
I'm trying the ProgressBar widget, but I'm missing some methods. Aren't they implemented or moved to other classes? - One is the pulse method, to activate the progressbar. - On the other side, to make the progressbar update while doing other work, if I understand right how it works, I should need other 2 methods: Gtk.EventsPending and Gtk.MainLoop... Is there any other way to deal with it? Thank you very much for your help... |
From: Alfonso <eu...@ya...> - 2008-02-26 15:25:17
|
I'm trying the ProgressBar widget, but I'm missing some methods. Aren't they implemented or moved to other classes? - One is the pulse method, to activate the progressbar. - On the other side, to make the progressbar update while doing other work, if I understand right how it works, I should need other 2 methods: Gtk.EventsPending and Gtk.MainIteration... Is there any other way to deal with it? My application should wait for a system call to end, checking periodically if it's ended, and while the OS performs the long time consuming task, the progressbar should update... Thank you very much for your help... |
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 |
From: Alfonso <eu...@ya...> - 2008-02-27 12:50:16
|
Andrew Cowie wrote: > 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 > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > ------------------------------------------------------------------------ > > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > Thread safe? That's great news to hear. Thank you very much for your answer. As for hacking, not shure if I have the needed knowledge to do it, but I'll have a look at the section, just in case I'm wrong. By the way, congrats for the excelent work you all are doing there. (I don't understand why aren't more enterprises contributing to this project. As I see it, it's a very important project for linux...). |