I have the following snippet of code that does not work:
···
-------------------------------
k={'parent':self, 'id':-1, 'title':'foo'}
f=wx.CheckBox(**k)
-------------------------------
File "/usr/local/lib/python2.3/site-packages/wxPython/controls.py", line 214, in __init__
self.this = controlsc.new_wxCheckBox(*_args,**_kwargs)
TypeError: new_wxCheckBox() takes at least 3 arguments (2 given)
-------------------------------
'self' is a wx.Panel direved object. A quick test of a few
(very limited) other objects that have required parameters
other than 'parent' and 'id' shows that any object with more
than 2 required parameters does not properly parse keywords.
Thus, for example, these work just fine using the above
trick:
wx.TextCtrl
wx.ComboBox
But these do not:
wx.Button
wx.CheckBox
Any possibility of getting a fix for this? I would like to
be able to use keyword dictionaries in many places as it
simplifies the code a *lot*, especially in derived classes
to handle arguments I don't need to worry about locally. If
it is a relatively simple fix (mostly grunt-work) I would be
willing to implement it myself given a pointer on where the
source of the problem exists.
--David