An activate event is sent when a window or application is being activated or deactivated.
^^
Handlers bound for the following event types will receive a wx.ActivateEvent parameter.
EVT_ACTIVATE: Process a wxEVT_ACTIVATE
event.
EVT_ACTIVATE_APP: Process a wxEVT_ACTIVATE_APP
event. This event is received by the App-derived instance only.
EVT_HIBERNATE: Process a hibernate event, supplying the member function. This event applies to wx.App only, and only on Windows SmartPhone and PocketPC. It is generated when the system is low on memory; the application should free up as much memory as possible, and restore full working state when it receives a wxEVT_ACTIVATE
or wxEVT_ACTIVATE_APP
event. ^^
Note
Until wxWidgets 3.1.0 activation events could be sent by wxMSW when the window was minimized. This reflected the native MSW behaviour but was often surprising and unexpected, so starting from 3.1.0 such events are not sent any more when the window is in the minimized state.
Constructor. |
|
Allows checking if the window was activated by clicking it with the mouse or in some other way. |
|
Returns |
See |
wx.
ActivateEvent
(Event)¶Possible constructors:
ActivateEvent(eventType=wxEVT_NULL, active=True, id=0,
ActivationReason=Reason_Unknown)
An activate event is sent when a window or application is being activated or deactivated.
__init__
(self, eventType=wxEVT_NULL, active=True, id=0, ActivationReason=Reason_Unknown)¶Constructor.
eventType (wx.EventType) –
active (bool) –
id (int) –
ActivationReason (Reason) –
GetActivationReason
(self)¶Allows checking if the window was activated by clicking it with the mouse or in some other way.
This method is currently only implemented in wxMSW and returns Reason_Mouse
there if the window was activated by a mouse click and Reason_Unknown
if it was activated in any other way (e.g. from keyboard or programmatically).
Under all the other platforms, Reason_Unknown
is always returned.
New in version 3.0.
GetActive
(self)¶Returns True
if the application or window is being activated, False
otherwise.
bool