focus events

I am trying to create an event handler that is activated whenever my frame gets focus from an unfocussed state. None of the obvious events seem to work: EVT_SET_FOCUS, EVT_COMMAND_SET_FOCUS… my handler is never called. What am I missing?

NOTICE: Empowered by Presidential Executive Orders, the National Security Agency may read this email without warning, warrant, or notice. The NSA may do this without any judicial or legislative oversight. The President also claims the right to designate the sender or the reader as an enemy combatant and to imprison him/her indefinitely without access to legal counsel or anyone else, and to be rendered to a foreign government for possible torture or death.

Hello,

···

On Fri, Jan 2, 2009 at 3:53 PM, $P!D3R DelSol sunsp1der@yahoo.com wrote:

I am trying to create an event handler that is activated whenever my frame gets focus from an unfocussed state. None of the obvious events seem to work: EVT_SET_FOCUS, EVT_COMMAND_SET_FOCUS… my handler is never called. What am I missing?

TopLevelWindows don’t get the focus, try wx.EVT_ACTIVATE instead. It will be called whenever the window is activated/deactivated (similar to get/lose focus.).

The event object has a method GetActive() that will tell you if it is getting or losing its active state.

Cody

That was it, thanks

···

Cody Precord codyprecord@gmail.com wrote:

Hello,

On Fri, Jan 2, 2009 at 3:53 PM, $P!D3R DelSol sunsp1der@yahoo.com wrote:

I am trying to create an event handler that is activated whenever my frame gets focus from an unfocussed state. None of the obvious events seem to work: EVT_SET_FOCUS, EVT_COMMAND_SET_FOCUS… my handler is never called. What am I missing?

TopLevelWindows don’t get the focus, try wx.EVT_ACTIVATE instead. It will be called whenever the window is activated/deactivated (similar to get/lose
focus.).

The event object has a method GetActive() that will tell you if it is getting or losing its active state.

Cody

NOTICE: Empowered by Presidential Executive Orders, the National Security Agency may read this email without warning, warrant, or notice. The NSA may do this without any judicial or legislative oversight. The President also claims the right to designate the sender or the reader as an enemy combatant and to imprison him/her indefinitely without access to legal counsel or anyone else, and to be rendered to a foreign government for possible torture or death.