[Mono-dev] timer locks up interface..

Felipe Almeida Lessa felipe.lessa at gmail.com
Thu Jan 12 21:47:13 EST 2006


Em Qui, 2006-01-12 às 23:34 +0100, Giovanni A. D. escreveu:
> hi,
> I'm a beginner with mono and yesterday I tried to do a simple hello
> world like app. using monodevelop and creating a glade 2 project
> (glade-project-2.0.dtd).
> 
> I'm using mono 1.1.13 installed with the installer.
> 
> 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:
> 
> ------------------------------------------------------------------------------------------------------------------------

<snip>

> ------------------------------------------------------------------------------------------------------------------------
> 
> thanks in advice for any reply.

Try using GLib timers. See monodoc for GLib.Timeout.Add. They play more
nicely with Gtk's main loop.

> bye,
> Giovanni.

Cya,
Felipe.

-- 
"Quem excele em empregar a força militar subjulga os exércitos dos
outros povos sem travar batalha, toma cidades fortificadas dos outros
povos sem as atacar e destrói os estados dos outros povos sem lutas
prolongadas. Deve lutar sob o Céu com o propósito primordial da
'preservação'. Desse modo suas armas não se embotarão, e os ganhos
poderão ser preservados. Essa é a estratégia para planejar ofensivas."

  -- Sun Tzu, em "A arte da guerra"




More information about the Mono-devel-list mailing list