Mixim Mixim - 1 month ago 14
C# Question

How can I close Gtk# Window

I have 2 fullscreen window in my Gtk# application, primary and secondary. I have buttonClose in second form's that click event handler must close this window and make some operation:

protected void OnButtonClose_Clicked (object sender, EventArgs e)
{
//some operation

this.Dispose ();
}


But window doesn't close! If I use this code in Primary window, that window will close and application will terminate. Why this code works for primary window and doesn't works for secondary? How can I close secondary window?

Answer

Try Window.Destroy() should destroy the window for the secondary window. You could also hide it with .Hide() but not sure that's your intention

Comments