From: <chr...@ph...> - 2004-05-13 08:09:04
|
Dear all, When I upgrade wxPython 2.4.0.4 to 2.5.1.5 the addMethod() function does not function properly anymore. I am running PythonCard 0.7.3.1 and python 2.2 (also in python 2.3 it gives the same results). The code works fine in the old wxPython. offending code snippet: def on_openBackground(self,event): for key in self.components.data: if isinstance(self.components[key],(wx.wxTextCtrl, wx.wxTextCtrlPtr)): exec 'def on_'+key+'_mouseDown(self,event): self.set_active(event.target)' exec 'self.addMethod(on_'+key+'_mouseDown)' gives the following error: c:\python22\lib\regsub.py:15: DeprecationWarning: the regsub module is deprecated; please use re.sub() DeprecationWarning) Traceback (most recent call last): File "C:\Python22\lib\site-packages\PythonCardPrototype\binding.py", line 268, in dispatchOpenBackground self.scriptable.dispatch.eventOccurred( event.OpenBackgroundEvent( self.scriptable ) ) File "C:\Python22\lib\site-packages\PythonCardPrototype\dispatch.py", line 83, in eventOccurred handler.getFunction()(self._scriptable, nativeEvent) File "corrector_control.py", line 56, in on_openBackground exec 'self.addMethod(on_'+key+'_mouseDown)' File "<string>", line 1, in ? File "C:\Python22\lib\site-packages\PythonCardPrototype\model.py", line 519, in addMethod self.__class__.__dict__[aMethod.__name__] = aMethod TypeError: object does not support item assignment I hope someone can fix this problem so we can safely upgrade to the latest wxPython. with best regards, Christiaan -- Dr. C. Kok (WY-41) Philips Research Eindhoven Prof. Holstlaan 4 5656 AA Eindhoven The Netherlands |