0

Хочу, чтобы было изначально выбрано значение "Неделя", а получается, что там пустое поле

    choiceVar = StringVar()
    choices = ("Месяц", "Неделя")
    choiceVar.set(choices[1])
    self.cb = ttk.Combobox(self.root, textvariable=choiceVar, values=choices, width=10, state='readonly', exportselection=0)
    self.cb.place(x=740, y=30)

Как получилось Как хочу

1 ответ 1

2
self.cb = ttk.Combobox(self.root, values=("Месяц", "Неделя"))
self.cb.current(1)

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.