Код: Выделить всё
import tkinter as tk
root = tk.Tk()
entryText1 = tk.Entry(root, bg='yellow')
entryText1.delete(0,tk.END)
entryText1.insert(0,'Enter Upper Threshold:')
entryText1.pack()
root.focus_force()
root.mainloop()
Я использую Mac с Python 3.12.4
Я немного поигрался, и если потом просто добавить кнопку, запись будет отображаться правильно.
Код: Выделить всё
import tkinter as tk
root = tk.Tk()
entryText1 = tk.Entry(root, bg='yellow', fg="red")
entryText1.delete(0,tk.END)
entryText1.insert(0,'Enter Upper Threshold:')
entryText1.pack()
button= tk.Button(root)
button.pack()
root.focus_force()
root.mainloop()
Код: Выделить всё
import tkinter as tk
root = tk.Tk()
input_frame= tk.Frame(root, width=200, height=200)
input_frame.pack()
entry = tk.Entry(input_frame, bg='yellow', fg="red") # Width of entry widget
entry.delete(0,tk.END)
entry.insert(0, 'Enter Upper Threshold:')
entry.pack()
root.focus_force()
root.mainloop()
Итак, реальный вопрос: почему tkinter не соответствует или что именно мне не хватает.
Есть ли способ сделать запись видимой после ее упаковки?
Подробнее здесь: https://stackoverflow.com/questions/792 ... -not-shown
Мобильная версия