Checkboxes With TKinter - Python Tkinter GUI Tutorial #17

preview_player
Показать описание
How to use Checkboxes With TKinter. In this video I'll show you how to create CheckBoxes with tKinter.

In this series I'll show you how to create graphical user interfaces for Python with Tkinter.

✅ Watch The Other Videos In This Python Playlist:

▶️ See More At:

✅ Join My Facebook Group:

✅ Subscribe To My YouTube Channel:

Take $22 off with coupon code: youtube
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

The issue you mentioned, is due to the var=StringVar(). Whenever you define the variable as string, the ''tristatevalue' attribute is activated, whose default value is an empty string. That's why when you click the button, it returns empty string. If you look closer, the checkbuton is sort of greyed out, meaning it's in the third state, neither ON or OFF.
Another way to make it unchecked by default is to set the variable to the 'offvalue' you changed to, before .pack(). For example, var.set("off").

zhenhuaxu
Автор

Went from almost never using Tkinter to making a pretty cool application thanks to your videos. Thank you!

Hatmaster
Автор

Per the StringVar() issue, StringVar() is empty so it is equal to empty quotes: "". The function is creating empty string labels.
You should create it with:
var = StringVar(value='off')
With IntVar(), it is either 0 or 1 so tkinter actually does this:
var = IntVar(value=0)

BWYT
Автор

I have been looking for this since ages...

yanalashivaprasadreddy
Автор

Thanks! This video helped me to get rid of that "rectangle" on checkbox when you put it on window. The var = InitVar() works!

Gacut
Автор

Thanks a lot my man! This is exactly what I am looking for noob like me!

quocbao
Автор

7:11 The reason why it is checked by default is, the checkbutton offvalue has an actual value inside. If you set offvalue="" then the default checked will disappear. But even if it disappears, still you'll need to make a small round of check and uncheck (6:35). Because, there are two default values inside your checkbutton(onvalue and offvalue). And your program knows that they are default choices not your choices. So program will not print them unless you choose them.

Abdulkadir-vbvj
Автор

Hello,
at 7:30 you use c.deselect() to set the checkbox initially to a 'not checked' state. While playing a bit with the code i found this alternative:
var = StringVar()
var.set('off')

MrJzvoyeur
Автор

is there any way to delete / destroy these checkboxes, like would it just be c.destroy? I cannot get this to work for me

benjiprime
Автор

putting these var.set("On") or var.set("Off") after var=StringVar() is also worked. I think at the initial state without starting any changes on checkbutton, the value in variable var is empty.

myohtet
Автор

Great job deserving of thanks
عمل رائع يستحق الشكر

ashrsfsiliman
Автор

Hello Sir I just Have A question i guess you are getting a lot of questions from me, sorry but i guess your the only one who can help me, anyways i noticed that when you run your app you use another application while you can run your program from sublime text by clicking ctrl + b why are there some cons of running the program from sublime text?

And Thank You🌹🌹

You really helped me through my journey of coding

musakayasimp
Автор

Var=StringVar()
Var.set("off")
Also use it..

sivasurya
Автор

God this is what I exactly wanted....thanks

vaishVee
Автор

Hi, thank you very much for your video.

parsabahrambeik
Автор

It looks like the checkbox is in the weird limbostate because your StringVar is not set to any value, so probably is a blank string, which is neither state. If you were to call var.set("Off") it'd be set correctly. Of course deslsect works too like you showed. :)

AhrenBaderJarvis
Автор

Thank you for the great video! I am trying to figure out a way to get 1 output only after I select 2 certain check boxes. Any idea on how to do this?

danielruelas
Автор

Is it possible to have a list with checkbox, image and text on tkinter?
I'd like to search for itens and return a list of itens with a image, description, and tick some of them.
Thanks for the video,
Best.

leorrosa
Автор

Hi. İf before the show function you write var.set(FALSE), checkbox comes unselected form.

oguzhankr