mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
27 lines
669 B
Python
27 lines
669 B
Python
from tkinter import *
|
|
import customtkinter
|
|
|
|
ws = customtkinter.CTk()
|
|
ws.title('PythonGuides')
|
|
ws.geometry('400x300')
|
|
|
|
def display_selected(choice):
|
|
choice = variable.get()
|
|
print("display_selected", choice)
|
|
|
|
countries = ['Bahamas','Canada', 'Cuba','United States']
|
|
|
|
# setting variable for Integers
|
|
variable = StringVar()
|
|
variable.set("test")
|
|
|
|
# creating widget
|
|
optionmenu_tk = OptionMenu(ws, variable, *countries, command=display_selected)
|
|
optionmenu_tk.pack(pady=10, padx=10)
|
|
|
|
optionmenu_1 = customtkinter.CTkOptionMenu(master=ws, variable=variable, values=countries, command=display_selected)
|
|
optionmenu_1.pack(pady=10, padx=10)
|
|
|
|
# infinite loop
|
|
ws.mainloop()
|