Re: [Java-gnome-developer] 'g_idle_add' and 'g_timeout_add' equivalents?
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2009-06-14 07:25:20
|
On Tue, 2009-06-09 at 10:23 +0200, Ernst Blaauw wrote: > One question about a thread: how do I 'synchronize' the interface with > the updated info from the Thread? Do I have to call cr.paint() once > every second or so? No, nothing so gauche. If you're using GTK, just call methods on Widgets as normal. They will generally queue a redraw internally. These will accumulate and then turn-up on screen as soon as the main loop cycles and their expose-events happen. > Can this be done from the other thread? Yes. Though not the point of the example, you can see this in action in ExampleInstantMessenger. [1] And in the update thread in Slashtime, come to think of it. [2] AfC Sydney [1]: http://java-gnome.sourceforge.net/4.0/doc/examples/textview/ExampleInstantMessenger.html [2]: http://research.operationaldynamics.com/projects/slashtime/ |