Пример, показывающий, что я имею в виду:
Это не работает...
Код: Выделить всё
from Tkinter import *
import ttk
master = Tk()
test = StringVar()
country = ttk.Combobox(master, textvariable=test)
country['values'] = ('USA', 'Canada', 'Australia')
country.pack()
# This does not set a default value...
test="hello"
mainloop()
Код: Выделить всё
from Tkinter import *
import ttk
master = Tk()
country = ttk.Combobox(master)
country['values'] = ('USA', 'Canada', 'Australia')
country.pack()
# This does set a default value.
country.set("hello")
mainloop()
Подробнее здесь: https://stackoverflow.com/questions/374 ... ms-useless