-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyGUI.py
38 lines (25 loc) · 781 Bytes
/
myGUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from tkinter import *
root = Tk()
root.geometry('200x200')
def enter():
L1.configure(text="Hello World")
def select():
selection = "Check:"+str(var1.get()+var2.get())
label.config(text=selection)
Space = Label(text=" ")
Space.grid(row=0, column=0)
F1 = LabelFrame(text="Setting", padx=10, pady=10)
F1.grid(row=1, column=1)
B1 = Button(F1, text="Enter", command=enter)
B1.grid(row=0, column=0)
L1 = Label(F1, text='')
L1.grid(row=1, column=0)
var1 = IntVar()
var2 = IntVar()
C1 = Checkbutton(F1, text="I love coffee", variable=var1, command=select)
C2 = Checkbutton(F1, text="I love milk", variable=var2, command=select)
C1.grid(row=3, column=0)
C2.grid(row=4, column=0)
label = Label(F1, text="Check: 0")
label.grid(row=5, column=0)
mainloop()