Re: [Java-gnome-developer] libtgtk-java refresh?
Brought to you by:
afcowie
From: Benjamin P. J. <bp...@gm...> - 2004-12-31 16:06:51
|
Replace the line that reads: label.setText("after"); It should be sth. like that: org.gnu.glib.CustomEvents.addEvent(new Runnable() { public void run() { label.setText("after"); } }); Cheers! Benjamin > Hi, > > I'm creating a Gtk program (not Gnome) but I have a problem that stuff > doesn't refresh until I move my mouse over the window. It's hard to explain > the problem so here's an example program. > > import org.gnu.gtk.*; > > public class Test extends Thread { > Label label; > > public static void main (String arg[]) { > Gtk.init(arg); > new Test(); > Gtk.main(); > } > > public Test() { > Window window = new Window(WindowType.TOPLEVEL); > label = new Label("bevore"); > window.add(label); > window.showAll(); > start(); > } > > public void run() { > try { > sleep(1000); > } catch(InterruptedException e) { > } > label.setText("after"); > //refresh? > } > } > > The text "after" only show up after I move the mouse over the window and not > after 1 second. Do I have to add some refresh line or something? Or am I > doing something else wrong (I don't need App do I?) This happens for > everything I tried (labels, buttons, progressBar) > > Thanks and happy new year ;) > David > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > |