Hello,
Recently upgraded to wxPython 2.4.2.4
Now existing program didn't work.
Here is the situation:
wxGrid - > ShtrafTableGrid (my derived class)
class ShtrafTableGrid(wxGrid):
def __init__(self, parent, header,data):
wxGrid.__init__(self, parent, -1)
....
....
def ReSet(self,data):
self.DeleteRows(0,self.GetNumberRows())
self.AppendRows(0,len(data))
This method is supposed to call parent 'DeleteRows' and 'AppendRows'
It was ok in wxPython 2.4.1.2.
It won't in wxPython 2.4.2.4
···
-------------------------------
Traceback (most recent call last):
File "adminpanel\adminpanel.py", line 327, in OnFilterButton
self.grid.ReSet(self.reload_list())
File "adminpanel\adminpanel.py", line 130, in ReSet
self.DeleteRows(0,self.GetNumberRows())
File "C:\Python22\Lib\site-packages\wxPython\grid.py", line 1006, in DeleteRows
val = gridc.wxGrid_DeleteRows(self, *_args, **_kwargs)
wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in e:\Projects\wx2.4\src\generic\grid.cpp(
2899): Called grid table class function DeleteRows
but your derived table class does not override this function
---------------------------------------
Seems like C++ part of wxPython is unhappy about that.
What can i do here?
I've tried to create 'dummy' overridden methods like:
def DeleteRows(self,pos,numRows):
super(type(ShtrafTableGrid),self).DeleteRows(pos,numRows)
def AppendRows(self,pos,numRows):
super(type(ShtrafTableGrid),self).AppendRows(pos,numRows)
But then python goes unhappy about 'self':
-------------
TypeError : super(type,obj):obj must be an instance or subtype of type.
-------------
How can i avoid this problems?
Or should i get back to 2.4.1.2 ?
win2k,python 2.2 , wxPython 2.4.2.4
--
With best regards,Igor.
mailto:igor@tyumbit.ru