我想要做的就是有 2 个班级
1- 创建一个网格
2- 获取网格并将其放入 wx.notebook
所以基本上一个类使网格另一个类将网格作为参数并将其添加到 wx.notebook
但我一直收到一个错误,说
self.m_grid1 = wx.grid.Grid(self) TypeError: Grid(): arguments did not match any overloaded call:
overload 1: too many arguments overload 2: argument 1 has unexpected type 'reportGrid'
这里是 Grid 类的代码称为 reportGrid
class reportGrid ():
def __init__( self, list):
self.m_grid1 = wx.grid.Grid(self)
self.m_grid1.Create(parent = None, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.WANTS_CHARS, name="Grid")
# Grid
self.m_grid1.CreateGrid( 7, 18 )
self.m_grid1.EnableEditing( True )
self.m_grid1.EnableGridLines( True )
self.m_grid1.SetGridLineColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
self.m_grid1.EnableDragGridSize( True )
self.m_grid1.SetMargins( 0, 0 )
# Columns
self.m_grid1.EnableDragColMove( False )
self.m_grid1.EnableDragColSize( True )
self.m_grid1.SetColLabelSize( 30 )
self.m_grid1.SetColLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )
# Rows
self.m_grid1.EnableDragRowSize( True )
self.m_grid1.SetRowLabelSize( 80 )
self.m_grid1.SetRowLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )
# Label Appearance
self.m_grid1.SetColLabelValue(0, "Yield")
self.m_grid1.SetColLabelValue(1, "64CU")
self.m_grid1.SetColLabelValue(2, "Yield")
self.m_grid1.SetColLabelValue(3, "60CU")
self.m_grid1.SetColLabelValue(4, "Chain")
self.m_grid1.SetColLabelValue(5, "Logic")
self.m_grid1.SetColLabelValue(6, "Delay")
self.m_grid1.SetColLabelValue(7, "BIST")
self.m_grid1.SetColLabelValue(8, "CREST")
self.m_grid1.SetColLabelValue(9, "HSIO")
相关分类