1
請幫忙!正如它在標題中所說 - 我無法獲得複選框'變量值。Python 3.x tkinter - 無法獲取複選框'變量值
def init_widgets(self):
ttk.Button(self.root, command=self.insert_txt, text='Button', width='10').place(x=10, y=10)
...
cbcc = ttk.Checkbutton(root, text="Damage", onvalue="on", offvalue='off').place(x=235, y=12)
...
def insert_txt(self):
...
cbcd = StringVar()
cbcd.get()
print(cbcd)
if cbcd == "on":
self.damage
else:
打印提供了「PY_VAR2」,並與我點擊,每次(PY_VAR3等)
哇,謝謝,幫了很多! :)感謝澄清這是如何工作和最好的問候! – moupy 2014-09-03 16:55:20