Home | Trees | Index | Help |
|
---|
Package wx :: Class CloseEvent |
|
object
--+ |Object
--+ |Event
--+ | CloseEvent
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 controls or
the system menu. It can also be invoked by the application itself
programmatically, for example by calling the wx.Window.Close
function.
You should check whether the application is forcing the deletion of
the window using CanVeto
. If it returns False, you must destroy
the window using wx.Window.Destroy
. If the return value is True,
it is up to you whether you respond by destroying the window or not.
For example you may wish to display a message dialog prompting to save
files or to cancel the close.
If you don't destroy the window, you should call 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 honored or not.
wx.EVT_CLOSE This event is sent to a top-level window when it has been requested to close either from the user or programatically. wx.EVT_QUERY_END_SESSION This event is sent to the wx.App
when the system is about to be logged off, giving the app a chance to veto the shutdown.wx.EVT_END_SESSION This event is sent to the wx.App
when the system is being logged off.
Method Summary | |
---|---|
CloseEvent |
Constructor. |
bool |
Returns true if you can veto a system shutdown or a window close event. |
bool |
Returns True if the user is logging off or False if the system is shutting down. |
bool | GetVeto(self)
|
Sets the 'can veto' 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. |
Property Summary | |
---|---|
LoggingOff : See GetLoggingOff and SetLoggingOff | |
thisown : The membership flag |
Method Details |
---|
__init__(self,
type=wxEVT_NULL,
winid=0)
|
CanVeto(self)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.
|
GetLoggingOff(self)Returns True if the user is 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.
|
SetCanVeto(self, canVeto)Sets the 'can veto' flag.
|
SetLoggingOff(self, logOff)Sets the 'logging off' flag.
|
Veto(self, 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 or close if
|
Property Details |
---|
LoggingOffSee
|
thisownThe membership flag |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:07:01 2007 | http://epydoc.sf.net |