[Gtk-sharp-list] GLib.Timerout How to use?

True Friend true.friend2004 at gmail.com
Sat Sep 13 22:33:17 EDT 2008


Hi
I want to add a timer in gtk(#) application to autosave text in textview. I
had used System.Timers.Timer while working on windows (on same application).
In gtk i am unable to find a way to get it done. I tried
System.Timers.Timer.Tick but it wasn't there in mono class library. I then
tried System.Timers.Timer.Elapsed but it won't worked. I then advised to use
GLib.Timeout. It also doesn't work. The problem which occurs (even with
System.Timers.Timer.Elapsed) is that when I click on the Action (menu item)
the gui freezes simply without any progress. Plz suggest me where I am
wrong. Here is the code I am trying to use behind a menu item toggle
(event).
--------------------------
protected virtual void OnAction19Toggled (object sender, System.EventArgs e)
    {
        if(this.Action19.Active == true)
        {
            while(this.Action19.Active)
            {
                GLib.Timeout.Add(1000, new
GLib.TimeoutHandler(AutoSaveEventHandler));
            }
        }
    }
-----------------------------
Regards
-- 
Muhammad Shakir Aziz محمد شاکر عزیز
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080914/4c07e2a9/attachment.html 


More information about the Gtk-sharp-list mailing list