On 7/16/06, Attila Zilizi <[EMAIL PROTECTED]> wrote:
> Hi all. I'm a beginner in programming.
>
> How is possible to display the system time on a label keeping updated
> every second?

Assuming that your label is called 'label', try

GLib.Timeout.Add (1000, delegate {
    label.Text = System.DateTime.Now.ToString ("t");
    return true;
};

This technique is the easiest way to do it in GTK#. Essentially,
GLib.Timeout.Add is used to add a delegate that should be called after
a given number of milliseconds (in this case, 1000ms, which is 1s).
The method returns true to indicate that it should be called again
when another 1000ms have elapsed.

-- 
Michael Hutchinson
http://mjhutchinson.com
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to