Problems with EVT_SET_FOCUS

Hi all,

I am trying to handle the wxEVT_SET_FOCUS event... without success.

The code goes like this:

class myPanelPy(wxPanel):
    def __init__(self, parent, ID):
        wxPanel.__init__(self, parent, ID)

        ...Some code here...

        EVT_SET_FOCUS(self, OnFocus)

        self.OnFocus(self, event):

I am getting into the OnFocus method only after the panel lost focus (the frame containing it was destroyed). What should I do?

Thanx in advance!

Ilia Kats wrote:

Hi all,

I am trying to handle the wxEVT_SET_FOCUS event... without success.

The code goes like this:

class myPanelPy(wxPanel):
    def __init__(self, parent, ID):
        wxPanel.__init__(self, parent, ID)

        ...Some code here...

        EVT_SET_FOCUS(self, OnFocus)

Panels don't normally get the focus, they always set it to one of their children.

···

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