title: GTK delete event
body: <p>I use GTK# and I need to abort a thread when the main window is closed. The thread is attached to the inner widget of the main one. I was trying to use delete and destroy events. I failed.</p>
  
  <pre><code>public class MyClass {
  
          GLWidget widget= new AnyWidget();
  
          public GLWidget widget{
              get { return widget; }
          }
          private float red = 0.0f;
  
          public MyClass ()
          {
              Thread producer = new Thread (new ThreadStart (ThreadRun));
              producer.Start ();
              widget.DeleteEvent += delegate { // I don't know what event I should use
                  producer.Abort ();
              };
          }
  
          public void ThreadRun()
          {
                      while (true) {
                   //TODO
                      }
          }
      }
  </code></pre>
  
  <p>The problem is that when I press close button my GTK# application is not being closed.</p>