[Java-gnome-developer] Keeping GUI responsive with java-gnome
Brought to you by:
afcowie
|
From: Björn H. <hu...@sr...> - 2010-02-08 17:07:06
|
Hello,
I am having trouble keeping my GUI responsive while doing a lengthy
operation. This is what I found on a code writing guide for Rhythmbox:
"Many times when some code has to perform a long computation or task, it
is actually a small task which is repeated many times." Well, this is
exactly the way my lengthy operation works. An idea is to insert a small
loop that checks for pending events each time the innermost loop is
entered (rather than using threads):
while (gtk_events_pending()) {
gtk_main_iteration();
}
At least that's the way how I could do it in C. And in fact, there have
been equivalents for these methods in java-gnome (Gtk.eventsPending()
and Gtk.mainIteration()). Unfortunately these equivalents no longer
exist in version 4. Can anyone tell me why these methods were removed
and what's the best way to do what I want?
Björn Hurling
|