[Mono-dev] timer locks up interface..

Michael Hutchinson m.j.hutchinson at gmail.com
Thu Jan 12 21:20:21 EST 2006


Hi,

> I've been able to set up a timer and the console output is exactly
> what I'd expect; the problem cames when I try to output the value of
> timecnt into a label..
>
> it displays correctly the first 2 times then the interface freeze and
> doesn't get update while the console output goes on fine.
>
> any tip/idea? here is the code I wrote:

Any interface updates to GTK# have to happen on the main application
thread, whereas (I think) System.Timers events will run in a separate
thread. There are several ways to execute code on the main thread, and
you can see some examples at
http://www.mono-project.com/Responsive_Applications

You will probably find the GLib.Timeout method useful.


Michael



More information about the Mono-devel-list mailing list