[英]Radio buttons in python 3 and tkinter
我已經使用Python 3和Tkinter編寫了一個程序,該程序使用單選按鈕。 現在,如何確定某些單選按鈕已被選中?
您想像這樣使用單選按鈕上的select方法:
import tkinter as tk
root = tk.Tk()
root.title("Radio Button Example")
button = tk.Radiobutton(root) # Make a radio button
button.pack() # Pack it to the screen
button.select() #This is the bit that makes it checked
root.mainloop()
有關tk中RadioButtons的更多信息,請查看教程上的此頁面:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.