Re: [gtk-list] Re: How to redirect Alt-F4 to hide instead of destroy.




Hi,

Here is the deal: most window managers have two different things they can
do to your window. One is usually called "Kill", and it calls
XKillClient(),  which basically nukes the application; you can't recover
from this, you have to exit. The "Close" button on window managers will
generally send you a delete_event; you can choose how to respond to
delete_event with a signal handler (if the signal _emission_ returns TRUE
then the default action will not happen; the default action is to
gtk_widget_destroy() your window). 

So, you need to know whether Alt-F4 does the kill or the delete_event. If
it just does delete_event, all you have to do is connect a delete_event
handler which returns TRUE and hides the window. If it sends kill, then
your whole app has been nuked.

My book explains this in more detail.

Havoc





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