added combobox values to themes

This commit is contained in:
Tom Schimansky
2022-06-02 01:25:13 +02:00
parent 807064a888
commit ecf6b8d9cf
3 changed files with 22 additions and 11 deletions

View File

@ -1,9 +1,8 @@
import tkinter
import tkinter.ttk as ttk
import customtkinter
app = customtkinter.CTk()
app.title('test_optionmenu.py')
app.title('Test OptionMenu ComboBox.py')
app.geometry('400x300')
@ -17,16 +16,16 @@ 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=10, padx=10)
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=10, padx=10)
combobox_1.pack(pady=20, padx=10)
app.mainloop()