0
3行2列の6つのボタン(キャンセル、削除、保存、終了、停止)の表を表示したいとします。 私はこのプログラムを以下で実行しようとしましたが、動作しませんでした。TypeError:GridSizer():オーバーロードされた呼び出しと引数が一致しません
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()
これはメッセージ全体のエラーです。
File "C:/Python34/Test_wxPython/Events/Identifiers.py", line 12, in __init__
grid = wx.GridSizer(3, 2)
TypeError: GridSizer(): arguments did not match any 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
この行に問題がありますが、私は問題を把握することができません。
wxpythonのバージョンは何ですか?3.0.2ではうまく動作します。 –