Re: How to prevent ESC-key from destroying windows?



On Fri, 2003-08-08 at 04:43, Ralf MÃller wrote:
Hello,

how can I prevent the gtk-application from destroying my windows when
ESC-key pressed (I only want 'gtk_widget_hide' not destroy)

When GtkDialog is closed via the escape key, it's just like
the user clicks the window manager close button, so you handle
it the same way:
 
 Connect a signal handler to delete-event that does
 what you want and returns TRUE

There is a conveniences signal handler prebuilt for this
situation:

 g_signal_connect (dialog, "delete-event",
                   G_CALLBACK (gtk_widget_hide_on_delete), NULL);

Regards,
                                        Owen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]