Yes,

Thx !

But now I have another problem : how to wait the end of the method's
execution. ?

public class HelloWorld {
 public void hello (object obj, EventArgs args)
 {
    Console.WriteLine ("Hello World");

    // How to wait the end of OnIdleHello ?

    Glib.Source.Remove (my_uint);
    i = 0;
    my_uint = GLib.Idle.Add (new IdleHandler (OnIdleHello));
    OnIdleHello();
 }

 public void OnIdleHello ()
 {
    while (i <= 100)
    {
      Console.WriteLine(i);
      Console.WriteLine(i+1);
      Thread.Sleep(3000);
    }
 }

On 2/27/07, Peter Johanson <[EMAIL PROTECTED]> wrote:

On Tue, Feb 27, 2007 at 06:01:40PM +0000, KLessou wrote:
>    Hello can we synchronize Glib.Idle Thread ?

<snip />

>
>         // How to stop the previous Thread here ?
>         GLib.Idle.Add (new IdleHandler (OnIdleHello));

GLib.Idle.Add returns a uint value, which can later be removed with:

GLib.Source.Remove (my_uint);

That should do what you want.

-pete

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




--
~~~~~
| klessou |
~~~~~
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to