イベントの設定をしようとして以下のようなコードを書いたのですが、関数の引数を
1.()内にそのまま書く
2.その他の手段を使う
のどちらにすればいいのでしょうか。
import wx
class MyFrame(wx.Frame):
def __init__(self,parent,title)
wx.Frame.__init__(self, parent, title=title, size=(300,250))
self.Menu()
self.Show(True)
#省略します
class Options:
def __init__(self,parentFrame):
self.Option(parentFrame)
def Option(self,parentFrame):
#省略します
self.Layouts(panel)
def Layouts(self,panel):
line1 = wx.TextCtrl(parentPanel,wx.ID_ANY)
#省略します
Button = wx.Button(parentPanel,wx.ID_ANY,"Run",size = (70,35))
Button.SetToolTipString(u"実行")
Button.Bind(wx.EVT_BUTTON,self.buttonEvent) #←この部分です
self.layoutOption(line1,line2,line3,line4,line5,Button,parentPanel)
#省略します
def buttonEvent(self, event): #←この部分です
line1.GetValue() #←この部分です
if __name__=="__main__":
app = wx.App()
frame = MyFrame(None, 'title')
adder = Options(frame)
app.MainLoop()
環境はWindows7,Python2.7でエディターはPyScripterです。