dropdown in tkinter
from Tkinter import *
master = Tk()
variable = StringVar(master)
variable.set("one") # default value
w = OptionMenu(master, variable, "one", "two", "three")
w.pack()
mainloop()
dropdown in tkinter
from Tkinter import *
master = Tk()
variable = StringVar(master)
variable.set("one") # default value
w = OptionMenu(master, variable, "one", "two", "three")
w.pack()
mainloop()
how to make a drop down box tkinter
from tkinter import *
from tkinter import ttk
screen = Tk()
my_weekdays_names = ["MONDAY","TUESDAY","WENSDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"]
def weekdaySelection(event):
for x in range(7):
if weekdaysDropdown.get() == my_weekdays_names[x]:
print(my_weekdays_names[x])
weekdaysDropdown = ttk.Combobox(screen, values = my_weekdays_names)
weekdaysDropdown.current(1)
weekdaysDropdown.bind("<<ComboboxSelected>>", weekdaySelection)
weekdaysDropdown.grid()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us