[Gtk-sharp-list] DestroyEvent

Finn Gruwier Larsen finn at gruwier.dk
Sat Mar 18 05:35:55 EST 2006


I've found the solution myself. It's much better to use Dialog instead 
of Window for the secondary window, and then use the Run method on 
Dialog to make the main window wait for either the Dialog.Response event.

This seems to be the general method of implementing GUIs with more than 
one window.

Best regards,

Finn Gruwier Larsen

Finn Gruwier Larsen wrote:
 > Hi,
 >
 > Here's another silly question from a newbie!
 >
 > Im my main window, I want a certain action to take place when another 
window, called uw, is destroyed.
 >
 > I have this code in my main window:
 >
 > private UnitWindow uw;
 > uw = new UnitWindow (currentUnit, true);
 > uw.DestroyEvent += new DestroyEventHandler(uwDestroyed);
 > uw.ShowAll();
 >
 > (...)
 >
 > public void uwDestroyed(object o, EventArgs args)
 > {
 >  statusbar.Push(1, "Unit stored.");
 > }
 >
 > The code compiles, but nothing is ever written in the statusbar. What 
 > goes wrong?


More information about the Gtk-sharp-list mailing list