[wxPython-users] Re: some question about custom events ...

Stef Mientki s.mientki at ru.nl
Sun Jul 1 03:05:01 PDT 2007


>> And this gives an error:
>>  JALsPy_Properties_Event, EVT_JALSPY_PROPERTIES_CHANGED =
>> wx.lib.newevent.NewCommandEvent()
>>  new_evt = JALsPy_Properties_Event( attr1="hello", attr2=654 )
>>
>> Traceback (most recent call last):
>>  File "D:\data_to_test\JALsPy\JALsPy_properties.py", line 165, in
>> OnEditorChange
>>    new_evt = JALsPy_Properties_Event( attr1="hello", attr2=654 )
>> TypeError: __init__() takes exactly 2 non-keyword arguments (1 given)
>>     
>
> As the error message says, a non-keyword arg is missing. In that case, the first
> argument has to be the ID of the control which sends the event, which can be
> determined by ctrl.GetID().
> I did not know that this is not neccessary for non CommandEvents, though.
>
>   
Thanks for the detailed explanantion Cristian.

cheers,
Stef Mientki





More information about the wxpython-users mailing list