How to detect a change of focus ?

For each interested control, intercept wx.EVT_KILL_FOCUS and wx.EVT_SET_FOCUS.
Then event.GetWindow() will give respectively the window that lost the focus and the one who took it.

···

2008/5/11 Stef Mientki s.mientki@ru.nl:

hello,

for a PPyGui emulator (written in wxPython),

I need to detect if focus changes to another control,

so I can show / hide the virtual keyboard.

Is there anyway to detect when focus changes ?

thanks,

Stef Mientki


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

raffaello wrote:

For each interested control, intercept wx.EVT_KILL_FOCUS and wx.EVT_SET_FOCUS.
Then event.GetWindow() will give respectively the window that lost the focus and the one who took it.

There is also EVT_CHILD_FOCUS which will be sent any time a child of the window gets the focus. This is an easy way to sense focus change for a group of widgets in the same hierachy.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!