何が悪いのかまったくわかりません>.<b
ボタン押したらラベルを変化させたいと思いますが,
なにかアドバイスください
from Tkinter import *
class App(Frame) :
def __init__(self, master = None) :
Frame.__init__(self, master)
self.init()
self.pack()
self.labelStr = "hi!"
def btn1func(self) :
self.labelStr = "btn1"
def btn2func(self) :
self.labelStr = "btn2"
def init(self) :
btn1 = Button(self, text = "btn1", command=self.btn1func())
btn2 = Button(self, text = "btn2", command=self.btn2func())
lbl = Label(self, text = self.labelStr)
btn1.pack()
btn2.pack()
lbl.pack()
btn3 = Button(self, text = "click here for exit", command=sys.exit)
btn3.pack()
app = App()
app.mainloop()