[Tutor] what is wrong with this?

jrlen balane nbbalane at gmail.com
Sat Feb 12 06:36:18 CET 2005


this code is for a MDIChildFrame, It has a MDIParentFrame and when I
run the MDIPrentFrame, there seems to be no problem, but when I
attempt to edit the MDIChildFrame using the designer mode in BOA (i'm
using BOA by the way), an error occurs that says:

TypeError: wxGrid_CreateGrid() takes at least 3 arguments (2 given)

please help. here is the code:

from wxPython.wx import *
from wxPython.grid import *
from wxPython.lib.mixins.grid import wxGridAutoEditMixin

def create(parent):
    return wxMDIChildFrame1(parent)

[wxID_WXMDICHILDFRAME1, wxID_WXMDICHILDFRAME1GRID1, 
] = map(lambda _init_ctrls: wxNewId(), range(2))

class wxMDIChildFrame1(wxMDIChildFrame):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wxMDIChildFrame.__init__(self, id=wxID_WXMDICHILDFRAME1,
              name='WXMDICHILDFRAME1', parent=prnt, pos=wxPoint(70, 147),
              size=wxSize(748, 331), style=wxDEFAULT_FRAME_STYLE,
              title='Table')
        self.SetClientSize(wxSize(740, 297))

        self.grid1 = wxGrid(id=wxID_WXMDICHILDFRAME1GRID1, name='grid1',
              parent=self, pos=wxPoint(0, 0), size=wxSize(740, 297), style=0)
        
        self.grid1.CreateGrid(100,6)
        self.grid1.SetColLabelValue(0, "Time")
        self.grid1.SetColLabelValue(1, "Irradiance")
        self.grid1.SetColLabelValue(2, "Module Temperature")
        self.grid1.SetColLabelValue(3, "Ambient Temperature")
        self.grid1.SetColLabelValue(4, "Voltage")
        self.grid1.SetColLabelValue(5, "Current")
        
        self.grid1.SetColSize(2, 125)
        self.grid1.SetColSize(3, 127)
        self.grid1.SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_BOTTOM)
        
    def __init__(self, parent):
        self._init_ctrls(parent)


More information about the Tutor mailing list