Learn Python tkinter GUI checkboxes easy ✔️
ฝัง
- เผยแพร่เมื่อ 4 ก.พ. 2025
- Python checkbox checkbutton tkinter GUI tutorial for beginners
#Python #checkbox #checkbutton #tkinter #GUI #tutorial #beginners
from tkinter import *
def display():
if(x.get()==1):
print("You agree!")
else:
print("You don't agree :(")
window = Tk()
x = IntVar()
python_photo = PhotoImage(file='Python.png')
check_button = Checkbutton(window,
text="I agree to something",
variable=x,
onvalue=1,
offvalue=0,
command=display,
font=('Arial',20),
fg='#00FF00',
bg='black',
activeforeground='#00FF00',
activebackground='black',
padx=25,
pady=10,
image=python_photo,
compound='left')
check_button.pack()
window.mainloop()
from tkinter import *
def display():
if(x.get()==1):
print("You agree!")
else:
print("You don't agree :(")
window = Tk()
x = IntVar()
python_photo = PhotoImage(file='Python.png')
check_button = Checkbutton(window,
text="I agree to something",
variable=x,
onvalue=1,
offvalue=0,
command=display,
font=('Arial',20),
fg='#00FF00',
bg='black',
activeforeground='#00FF00',
activebackground='black',
padx=25,
pady=10,
image=python_photo,
compound='left')
check_button.pack()
window.mainloop()
I like the way you neatly list the attributes in readable form. I haven't seen anyone else do this yet, but it is so much better, more pleasant to code this way.
Brief, to the point
Thanks for sharing
Keep it up
I agree that this is a great tutorial !! thanks as always
Thanks buddy! Your video is the best on youtube.
Fantastic explanation so professional 🙏🏼👏🏻
so far it is lovely. you are a legend
As usual great video!
Thank you Game!
thank you thank you thank you so much i love u
Was this video helpful? ✓
Still 30 video left eventually , I wonder what to learn about python after this course ?
Thanks!!! I hope your pandas course
help me lot for the exam
NIce
Great!
Thanks
Nice!
nice
Ty Bro!
Thank you!
شكرا
I love this one
Please make video how to insert image in GUI
hi Dude, how you doing? how did u manage have same bg color image as main? help
Hi, I have a question unrelated to this video, but you always replied to comments so I guessed I might post it here.
I have made some projects with python on my own, and I thought about including them somehow in my Curriculum Vitae, so that people can verify that they are mine while still looking kind of professional.
I'm not really sure how to do it. My first thought was a link to something like GitHub that is free (maybe GitHub itself if its free version allows to do what I want). Would you recommend something?
Thanks in advance!
I don't have much experience with GitHub, so I don't want to give you the wrong advice. But I do know that many people do post their code to share in a form that is called a 'gist'. That may be what you are looking for.
Wow!
PLS REPLY how do u get that screen i only can use untilted file which isnt like that output
myMan
If have two checkbox I want to add to ButtonGroup like java how
But what if you want to be able to have the checkbox set by default?
You can do this using the set() method. For example:
t=IntVar()
t.set(1)
k = Checkbutton(window,
text="message text",
onvalue=1,
ofvalue=0)
k.pack()
meow meow meow~!
can u tell me why i cant ser the box
hmmmm are you using .pack() ?
Hey bro
My active Foreground
And active background
Does not work
What should I do
oky.
Thank you!