wxpython - TypeError: GridSizer(): arguments did not match any overloaded call -
i display table of 6 buttons(cancel,delete,save,quit,stop,new), 3 rows , 2 colunms. tried run program below, did not work.
import wx class identifiers(wx.frame): def __init__(self, parent, id, title): wx.frame.__init__(self, parent, id, title, size=(200, 150)) panel = wx.panel(self, -1) grid = wx.gridsizer(3, 2) grid.addmany([(wx.button(panel, wx.id_cancel), 0, wx.top | wx.left, 9), (wx.button(panel, wx.id_delete), 0, wx.top, 9), (wx.button(panel, wx.id_save), 0, wx.left, 9), (wx.button(panel, wx.id_exit)), (wx.button(panel, wx.id_stop), 0, wx.left, 9), (wx.button(panel, wx.id_new))]) self.bind(wx.evt_button, self.onquit, id=wx.id_exit) panel.setsizer(grid) self.centre() self.show(true) def onquit(self, event): self.close() app = wx.app() identifiers(none, -1, '') app.mainloop()
this whole message error.
file "c:/python34/test_wxpython/events/identifiers.py", line 12, in __init__ grid = wx.gridsizer(3, 2) typeerror: gridsizer(): arguments did not match overloaded call: overload 1: not enough arguments overload 2: argument 2 has unexpected type 'int' overload 3: not enough arguments overload 4: not enough arguments
there problem line grid = wx.gridsizer(3, 2)
, not manage figure out problem.
as running python 3.4 presume using wxpython phoenix. according documentation of wx.gridsizer
2 int
not match of allowed signatures. use e.g. 3 integers instead.
Comments
Post a Comment