-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathradio_button.py
More file actions
42 lines (31 loc) · 1.13 KB
/
radio_button.py
File metadata and controls
42 lines (31 loc) · 1.13 KB
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
39
40
41
42
from tkinter import *
# Creating display function
def display():
print(f"Placed an order for {foodList[x.get()]}")
# Creating Window
window = Tk()
# Styling Window
window.title("Radio Button Program Tkinter")
window.geometry("250x400")
window.config(bg="black")
# Creating Radio Buttons
foodList = ["Pizza", "Burger", "Fries"]
x = IntVar()
for food in foodList:
radioButton = Radiobutton(window,
text=food,
font=("Audiowide", 15, "italic"),
variable=x,
value=foodList.index(food),
command=display,
# indicatoron=0,
# width=400,
background="black",
fg="#00ff00",
activebackground="black",
activeforeground="#00ff00",
padx=25,
pady=10)
radioButton.pack(anchor=W)
# Displaying Window
window.mainloop()