16. Tkinter: Checkboxes
Channel:
Subscribers:
5,850
Published on ● Video Link: https://www.youtube.com/watch?v=EnmOLGBxvvs
Video code
from tkinter import *
def submit():
if result1.get() == 1:
print("Python is great")
if result2.get() == 1:
print("C++ is great")
if result1.get() == 0 and result2.get() == 0:
print("You do not like either option")
window = Tk()
window.title("My program")
window.geometry("350x200")
result1 = IntVar()
result2 = IntVar()
c1 = Checkbutton(window, text="Python", variable=result1, onvalue=1, offvalue=0)
c1.pack()
c2 = Checkbutton(window, text="C++", variable=result2, onvalue=1, offvalue=0)
c2.pack()
button = Button(window, text="Submit", command=submit)
button.pack(side=BOTTOM, fill =Y,)
window.mainloop()
Other Videos By Game Design with Reilly
2021-03-09 | Construct 3: introduction |
2020-05-03 | 7. JavaScript: While Loops |
2020-05-03 | 6. JavaScript: For Loop |
2020-05-03 | 5. JavaScript: Arrays |
2020-04-29 | 4.JavaScript - If Statement |
2020-04-29 | 3. JavaScript: Code Comments |
2020-04-29 | 2. Javascript: Variables |
2020-04-29 | 1. JavaScript: Outputs |
2020-04-22 | 18. Tkinter: Scales / Sliders |
2020-04-22 | 17. Tkinter: Combo Box |
2020-04-22 | 16. Tkinter: Checkboxes |
2020-04-22 | 15. Tkinter: Radio buttons |
2020-04-22 | 14. Tkinter: Text Entry |
2020-04-08 | 13. Tkinter: ScrollText |
2020-04-08 | 12. Tkinter: Notebook and keyboard inputs |
2020-04-08 | 11. Tkinter: Notebook |
2020-04-08 | 10. Tkinter: Keyboard input |
2020-04-08 | 9. Tkinter: Looping a grid |
2020-04-01 | 8. Tkinter: Frames |
2020-04-01 | 7. Tkinter: Place Layout |
2020-04-01 | 6. Tkinter: Grid Layout |
Tags:
tkinter
python
intro
introduction
tutorial
keyboard
notebook
scroll
text
entry
buttons
radio
combo
checkbox
scales
sliders