[Gtk-sharp-list] How to stop an Idle Thread

KLessou klessou at gmail.com
Wed Feb 28 10:09:37 EST 2007


Sorry it's something like this :

On 2/28/07, KLessou <klessou at gmail.com> wrote:
>
> 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 ()
>   {
>        i ++;
>
>        Console.WriteLine(i);
>        Console.WriteLine(i+1);
>        Thread.Sleep(3000);


           if (i = 100) return false;

           return true;

>   }
>
> On 2/27/07, Peter Johanson < latexer at gentoo.org> 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  -   Gtk-sharp-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> >
>
>
>
> --
> ~~~~~
> | klessou |
> ~~~~~




-- 
~~~~~
| klessou |
~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20070228/d62e70b7/attachment.html 


More information about the Gtk-sharp-list mailing list