help setfocus()

iip wrote:

Hi Robin,

Sorry, but I get message after I put that statement, below is the
error:

Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\wxPython\wx.py", line 1712, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "C:\Python23\Lib\site-packages\wxPython\windows.py", line 406, in SetFocus
    val = windowsc.wxWindow_SetFocus(self, *_args, **_kwargs)
TypeError: an integer is required

I got similar message for event.GetKeyCode() too,

Do you know why?

No.

SetFocus does not need an integer parameter... Perhaps this is an exception that is raised somewhere else but not properly caught until this point. Do you have a handler for EVT_SET_FOCUS bound to the window that you are setting focus to? If so then take a look at its code.

···

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