Hello,
I start a large computation in a thread of my program, and I want this thread to update a label. I know this looks like a classical issue, but I can't find an easy solution. Can you please give me a solution, or point me towards a link ?


class myApp
{
   Label myLabel;

   public static void Main (string[] args)
   {
       new myApp ();
   }

   public myApp()
   {
      //build a Gtk# window an add a label called myLabel

      Thread oThread = new Thread(this.LongComputation);
      oThread.IsBackground = true;
      oThread.Start();
   }

   public void LongComputation()
   {
      for (int i = 0; i < 100000000000000; i++)
         myLabel.Text = "#" + i;
   }
}

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

Reply via email to