[wxPython] newbie grid confusion...

I am attempting to use grid and it's associated classes. I have
received an error about which I am totally at a loss. This is, of
course, cannibalized code from the grid demo. Thanks ahead for
any help. Below is the trace:

Traceback (innermost last):
  File "D:\Python20\pythonDev\tableGrid.py", line 45, in ?
    frame = TestFrame(None)
  File "D:\Python20\pythonDev\tableGrid.py", line 36, in __init__
    gridData = GridData(labels, types, data)
  File "d:\python20\wxPython\grid.py", line 718, in __init__
    self.this = apply(gridc.new_wxPyGridTableBase,_args,_kwargs)
TypeError: new_wxPyGridTableBase requires exactly 0 arguments; 3
given

···

==========================================================================

Here is where tableGrid is being tested:

class TestFrame(wxFrame):
    
    def __init__(self, parent):
        wxFrame.__init__(self, parent, -1, "Table Grid",
size=(640,480))
        labels = ['One', 'Two']
        types = [wxGRID_VALUE_STRING, wxGRID_VALUE_STRING]
        data = [['string1', 'string2'], ['string3', 'string4']]
        gridData = GridData(labels, types, data)
        grid = TableGrid(self, gridData)

=========================================================================
And here is the init for GridData:

from wxPython.wx import *
from wxPython.grid import *
import string

#----------------------------------------------------

class GridData(wxPyGridTableBase):

    def __init_(self,labels, types, data):
        wxPyGridTableBase.__init__(self)
        self.labels = labels
        self.types = types
        self.data = data

Here's the problem:

class GridData(wxPyGridTableBase):

    def __init_(self,labels, types, data):
               ^
one underscore -- make that two, and all will be well.

--Patricia

Thank you. Thank you. Thank you. It was so obvious I never would
have seen it. Now I can go back to real work.

Patricia Hawkins wrote:

···

Here's the problem:

class GridData(wxPyGridTableBase):

    def __init_(self,labels, types, data):
               ^
one underscore -- make that two, and all will be well.

--Patricia

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users