From: Alex Fenton Date: 2008-01-07T06:19:59+09:00 Subject: Re: Intercepting events with wxRuby/wxWidgets Rainer wrote: > Hello everybody, > > I have a question concerning wxRuby/wxWidgets. I'm getting my feet wet > with a simple application that holds one Wx::Frame called VwX. As noted, wxruby-users is a better place to ask questions specifically about wxRuby. > When my application gets closed, I want the user to decide whether the > app really will shut down. If it shuts down: Save the last changes or > not? Typical Yes/No/Cancel situation. So I do this: (Remark: > VwXEvOnClose(event) is the "on_close" event of my Wx::Frame): ... > This works as it is supposed to. However, I noticed that the call to > "event.veto" might just as well be missing without any problems. OTOH, > the calls to "event.skip" are essential: If I dont call these, the > application simply won't shut down. Any ideas why the veto is > unimportant? The veto method only applies to close events; the documentation explains that: "If you don't destroy the window, you should call Wx::CloseEvent#veto to let the calling code know that you did not destroy the window. This allows the Wx::Window#close function to return true or false depending on whether the close instruction was honoured or not." hth alex