[Gtk-sharp-list] Label refresh on a Gtk.Window used as SplashScreen

Jacek Rużyczka stacheldraht at interia.pl
Thu Aug 18 13:24:42 EDT 2011


Hi,

Am Donnerstag 18 August 2011, 17:52:47 schrieb Mattia Vitturi:
> Hello everyone!
> 
> I'm working on a sort of splashscreen and I am facing some problems.
> On my splashscreen I've got a label that should be refreshed every second
> to add a dot (from "Loading . ." to "Loading . . ." for example).
> 
> So, on my splashscreen constructor I've got these lines:
> 
> _label = new Label { UseMarkup = true, Xalign = 0, Text = "Loading .", };
> _timer = new Timer(TimerCallback, null, 0, 1000);
> 
> ...and in the same class, I've got:
> 
> private void TimerCallback(object state)
> {
>         Console.WriteLine("Dotting");
> 	_label.Text += " .";
> }
> 
> 
Beware of using timers for accessing the GUI. Gtk# is NOT thread-safe at all, 
so that GUI manipulations may lead to various kind of trouble! Instead, use 
Gtk.Application.Invoke to handle accesses from side threads.

Kind regards
Jacek



----------------------------------------------------------------
Szukasz niepowtarzalnej bizuterii? 
Sprawdz >> http://linkint.pl/f2a1a


More information about the Gtk-sharp-list mailing list