[Gtk-sharp-list] Hiding Gtk.Window instead of Destroying?

Thomas Zühlke muell_muell_ at gmx.net
Wed Mar 1 17:08:58 EST 2006


Thanks, your example works fine!!!
It was my fault! I tryed to override OnDestroyEvent with return true and 
OnDeleteEvent with return false and it didn't work. I haven't tested the 
other combination.
Thanks a lot Scott!

>What I suggested works:
>
>using System;
>using Gtk;
>
>class T : Window
>{
>     static void Main ()
>     {
>		  Application.Init ();
>          T t = new T();
>		  t.ShowAll();
>          Application.Run ();
>	 }
>
>     T () : base ("HALLO")
>     {
>          SetDefaultSize (400, 400);
>     }
>
>     protected override bool OnDeleteEvent ( Gdk.Event e )
>     {
>          Console.WriteLine("HI");
>		  return true;
>     }
>} 
>
>Scott
>
>On Wed, 2006-03-01 at 17:47 +0100, Thomas Zühlke wrote:
>  
>
>>I also tryed this way. Set return TRUE or FALSE don't make a difference :-(
>>
>>    
>>
>>>You could try overriding OnDeleteEvent and not calling the base method.
>>>Not sure if this works or causes any issues.
>>>
>>>Scott
>>>
>>>On Wed, 2006-03-01 at 11:39 +0100, Thomas Zühlke wrote:
>>> 
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>I have a main-window and that creates a second window I work with. I can 
>>>>show/hide the second window with a button on the main window. If the 
>>>>button is pressed, the second window will be set do "visible = false;" 
>>>>and everything works fine.
>>>>
>>>>Now I want to hide the second window instead of closing it if the 
>>>>close-button (the X in the top-right corner) is pressed. Is this possible?
>>>>Should I define the DeleteEvent? But what should be done in this event?
>>>>
>>>>Thx Thomas
>>>>_______________________________________________
>>>>Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>>>>http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>>>>   
>>>>
>>>>        
>>>>
>>>_______________________________________________
>>>Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>>>http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>>>
>>>
>>> 
>>>
>>>      
>>>
>>_______________________________________________
>>Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>>http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>>    
>>
>
>_______________________________________________
>Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
>  
>


More information about the Gtk-sharp-list mailing list