enhanced dropdown_menu_fallback.py

This commit is contained in:
Tom Schimansky
2022-06-13 15:08:13 +02:00
parent 9c479bc1de
commit 91e7e3077c
7 changed files with 101 additions and 26 deletions

View File

@ -1,4 +1,5 @@
import tkinter
import tkinter.ttk as ttk
import customtkinter
app = customtkinter.CTk()
@ -16,14 +17,14 @@ countries = ['Bahamas', 'Canada', 'Cuba', 'United States']
variable = tkinter.StringVar()
variable.set("test")
# optionmenu_tk = tkinter.OptionMenu(app, variable, *countries, command=select_callback)
# optionmenu_tk.pack(pady=10, padx=10)
optionmenu_tk = tkinter.OptionMenu(app, variable, *countries, command=select_callback)
optionmenu_tk.pack(pady=10, padx=10)
optionmenu_1 = customtkinter.CTkOptionMenu(app, variable=variable, values=countries, command=select_callback)
optionmenu_1.pack(pady=20, padx=10)
# combobox_tk = ttk.Combobox(app, values=countries)
# combobox_tk.pack(pady=10, padx=10)
combobox_tk = ttk.Combobox(app, values=countries)
combobox_tk.pack(pady=10, padx=10)
combobox_1 = customtkinter.CTkComboBox(app, variable=variable, values=countries, command=select_callback)
combobox_1.pack(pady=20, padx=10)