.\" This is a wxWidgets manpage page generated from the XML docs .TH wxCloseEvent 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxCloseEvent \- A close window or end session event .SH DESCRIPTION This event class contains information about window and session close events. The handler function for EVT_CLOSE is called when the user has tried to close a a frame or dialog box using the window manager (X) or system menu (Windows). It can also be invoked by the application itself programmatically, for example by calling the wxWindow::Close function. You should check whether the application is forcing the deletion of the window using wxCloseEvent::CanVeto . If this is false , you must destroy the window using wxWindow::Destroy . If the return value is true, it is up to you whether you respond by destroying the window. If you don't destroy the window, you should call wxCloseEvent::Veto to let the calling code know that you did not destroy the window. This allows the wxWindow::Close function to return true or false depending on whether the close instruction was honoured or not. .SH "PARENTS" wxEvent .SH "INCLUDE FILES" wx/event.h .SH MEMBERS .SS wxCloseEvent (WXTYPE commandEventType = 0int id = 0) Constructor. .SS bool CanVeto () Returns true if you can veto a system shutdown or a window close event. Vetoing a window close event is not possible if the calling code wishes to force the application to exit, and so this function must be called to check this. .SS bool GetLoggingOff () Returns true if the user is just logging off or false if the system is shutting down. This method can only be called for end session and query end session events, it doesn't make sense for close window event. .SS bool GetForce () Returns true if the application wishes to force the window to close. This will shortly be obsolete, replaced by CanVeto. .SS void SetCanVeto (bool canVeto) Sets the 'can veto' flag. .SS void SetForce (bool force) Sets the 'force' flag. .SS void SetLoggingOff (bool loggingOff) Sets the 'logging off' flag. .SS void Veto (bool veto = true) Call this from your event handler to veto a system shutdown or to signal to the calling application that a window close did not happen. You can only veto a shutdown if wxCloseEvent::CanVeto returns true. .SH EVENTS .SS EVT_CLOSE(func) Process a close event, supplying the member function. This event applies to wxFrame and wxDialog classes. .SS EVT_QUERY_END_SESSION(func) Process a query end session event, supplying the member function. This event applies to wxApp only. .SS EVT_END_SESSION(func) Process an end session event, supplying the member function. This event applies to wxApp only. .SH "SEE ALSO" wxEvent wxWindow::Close , Window deletion overview .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.