forked from flatplanet/Intro-To-TKinter-Youtube-Course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdropdown2.py
48 lines (32 loc) · 899 Bytes
/
dropdown2.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
39
40
41
42
43
44
45
46
47
from tkinter import *
from PIL import ImageTk,Image
from tkinter import ttk
root = Tk()
root.title('Codemy.com - Learn To Code!')
root.iconbitmap('c:/gui/codemy.ico')
root.geometry("400x400")
# Drop Down Boxes
def clicking(event):
myLabel = Label(root, text=droped.get()).pack()
def clicker(event):
myLabel = Label(root, text=clicked.get()).pack()
def show():
myLabel = Label(root, text=clicked.get()).pack()
options = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
]
clicked = StringVar()
clicked.set(options[0])
drop = OptionMenu(root, clicked, *options, command=clicker)
drop.pack()
droped = ttk.Combobox(root, value=["Search by...", "Last Name", "Email Address", "Customer ID"])
droped.current(0)
droped.bind("<<ComboboxSelected>>", clicking)
droped.pack()
#myButton = Button(root, text="Show Selection", command=show).pack()
root.mainloop()