Re: [gtkmm] Trapping/cancelling window close events

On Mon, 2003-01-20 at 10:43, jyasskin mail utexas edu wrote:
> On Mon, Jan 20, 2003 at 10:09:04AM +0100, Murray Cumming wrote:
> > On Mon, 2003-01-20 at 09:45, jyasskin mail utexas edu wrote:
> > > I'm wondering how to trap window close events in order to, for example,
> > > present a typical 'Save, Discard, or Cancel' dialog to the user.
> > > Application generated events are, of course, easy to handle, since I can
> > > just put code before the hide() call. I'm more concerned with when the
> > > user uses a window decoration to close the window. The documentation
> > > doesn't even mention this as a possibility. I think I could provide Save
> > > or Discard by connecting to signal_hide, but since it returns void,
> > > there's no way to cancel the close. Is there a way to do this? 
> > 
> > You can override on_delete_event(). See Bakery for an example.
> > 
> Thank you for the very prompt answer.
> It turns out that this event is mentioned in chapter 21 of the gtkmm
> book. Isn't it generally useful enough to be described in a more
> prominent place  (Like the doxygen docs)?


Murray Cumming
murray usa net

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