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. |
__repr__(self)
| |
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. | |
Inherited from Event | |
| |
Event |
|
Object |
Returns the object (usually a window) associated with the event, if any. |
wxEventType |
Returns the identifier of the given event type, such as wxEVT_COMMAND_BUTTON_CLICKED. |
int |
Returns the identifier associated with this event, such as a button command id. |
bool |
Returns true if the event handler should be skipped, false otherwise. |
long |
|
bool |
Returns true if the event is or is derived from wx.CommandEvent else
it returns false. |
Resume the event propagation by restoring the propagation level. | |
Sets the originating object, or in other words, obj is normally the object that is sending the event. | |
Sets the specific type of the event. | |
Set's the ID for the event. | |
| |
bool |
Test if this event should be propagated to the parent window or not, i.e. |
Called by an event handler, it controls whether additional event handlers bound to this event will be called after the current event handler returns. | |
int |
Stop the event from propagating to its parent window. |
Inherited from Object | |
Deletes the C++ object this Python object is a proxy for. | |
String |
Returns the class name of the C++ class using wxRTTI. |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
Return hash(x)... | |
Return a new object with type S, a subtype of T... | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
Return str(x)... |
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
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:46:52 2007 | http://epydoc.sf.net |