tkinter check button
先宣個一個參數的物件
varB = tk.BooleanVar()
set 初始值
varB.set(True)
給 check button 設定 var 參數
ckBtn = tk.Checkbutton(root, text="I am a check button",var=varB)
ckBtn.grid(row=0, column = 0)
想要得到參數
ckBtn.get()
如
if ckBtn.get() is True:
print "I am true"
varB = tk.StringVar()
給 check button 設定 var 參數
ckBtn = tk.Checkbutton(root, text="i am a check button", var=varB,
onvalue="yes", offvalue="no")
想要得到參數
ckBtn.get()
如
if ckBtn.get() == "yes":
print "I am yes"
varB = tk.BooleanVar()
set 初始值
varB.set(True)
給 check button 設定 var 參數
ckBtn = tk.Checkbutton(root, text="I am a check button",var=varB)
ckBtn.grid(row=0, column = 0)
想要得到參數
ckBtn.get()
如
if ckBtn.get() is True:
print "I am true"
也可以把參數換成String
varB = tk.StringVar()
給 check button 設定 var 參數
ckBtn = tk.Checkbutton(root, text="i am a check button", var=varB,
onvalue="yes", offvalue="no")
想要得到參數
ckBtn.get()
如
if ckBtn.get() == "yes":
print "I am yes"
Betfair Casino - Get 100% Bonus up to £100 + 200 Spins!
回覆刪除Betfair Casino 코인갤러리 is a great alternative to other 코인갤 online 토토사이트코드 casinos, however the 피나클 company has a lot to offer and 바카라시스템배팅법 the software is superb and safe.