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 Window#close function.
You should check whether the application is forcing the deletion of the window
using CloseEvent#can_veto. If this is false
,
you must destroy the window using Window#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 CloseEvent#veto to
let the calling code know that you did not destroy the window. This allows the Window#close function
to return true
or false
depending on whether the close instruction was honoured or not.
To process a close event, use these event handler macros to direct input to member
functions that take a CloseEvent argument.
evt_close() { | event | … } | Process a close event, supplying the member function. Thisevent applies to Frame and Dialog classes. |
evt_query_end_session() { | event | … } | Process a query end session event, supplying the member function.This event applies to App only. |
evt_end_session() { | event | … } | Process an end session event, supplying the member function.This event applies to App only. |
Window#close, Window deletion overview
Constructor.
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.
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.
Sets the ‘can veto’ flag.
Sets the ‘force’ flag.
Sets the ‘logging off’ flag.
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 CloseEvent#can_veto returns
true.
[This page automatically generated from the Textile source at 2023-06-09 00:45:25 +0000]