Closing a gtk app from a menu



In a simple App it is easy to exit a programme either via the window
close button or a menu option named quit which is connected to
gtk-main-quit().  However, in most apps it is desirable to check the
user actually wants to exit before shutting down the programme.  Via the
window close button this is straightforward - you just connect a
callback to the delete event and return true or false as appropriate.
gtk_main_quit can then be connected to the destroy event which I
understand is sent if the delete event callback returns FALSE.  The
question I have is how to achieve the same behaviour from a menu
selection.  I cannot connect it directly to the dlelete event callback
because the event has not happened and the subsequent destroy event does
not occur.

Ian







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