chech box in tkinter
from tkinter import *
master = Tk()
var1 = IntVar()
Checkbutton(master, text="male", variable=var1).grid(row=0, sticky=W)
var2 = IntVar()
Checkbutton(master, text="female", variable=var2).grid(row=1, sticky=W)
mainloop()
chech box in tkinter
from tkinter import *
master = Tk()
var1 = IntVar()
Checkbutton(master, text="male", variable=var1).grid(row=0, sticky=W)
var2 = IntVar()
Checkbutton(master, text="female", variable=var2).grid(row=1, sticky=W)
mainloop()
tkinter create checkbox
import tkinter as tk
from tkinter import tkk
root = tk.Tk()
value = tk.BooleanVar()
def onCheck():
print(f"Is radiobutton checked? {value}")
radio = ttk.Radiobutton(
master=root,
text="checkbox",
variable=value,
onvalue=True,
offvalue=False,
command=onCheck
)
radio.pack()
root.mainloop()
how to get checkbutton from a list
from Tkinter import *
root = Tk()
users = ['Anne', 'Bea', 'Chris']
for x in range(len(users)):
l = Checkbutton(root, text=users[x][0], variable=users[x])
print "l = Checkbutton(root, text=" + str(users[x][0]) + ", variable=" + str(users[x])
l.pack(anchor = 'w')
root.mainloop()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us