У меня есть графический интерфейс Tkinter, где у меня есть поле ввода текста, поле вывода текста и
кнопка.Пользователь печатает что-либо в текстовом поле и нажимает кнопку, после чего оно должно быть напечатано в поле вывода.Но здесь входные значения не вставляются в поле вывода.
from tkinter import *
base = Tk()
base.title('Demo')
base.geometry("400x500")
base.resizable(width=FALSE, height=FALSE)
outputwindow = Text(base, bd=0, bg="white", height="8", width="50", font="Arial",)
# outputwindow.insert(END, "Connecting to your partner..\n")
outputwindow.config(state=DISABLED)
#Bind a scrollbar to the Chat window
scrollbar = Scrollbar(base, command=outputwindow.yview, cursor="heart")
outputwindow['yscrollcommand'] = scrollbar.set
EntryBox = Text(base, bd=0, bg="white",width="29", height="5", font="Arial")
def ClickAction():
input=EntryBox.get("1.0",END)
print(input)
EntryBox.delete('1.0',END)
outputwindow.insert(END, input)
SendButton = Button(base, font=30, text="Send", width="12", height=5,bd=0, bg="lightgray", command=ClickAction)
#Place all components on the screen
scrollbar.place(x=376,y=6, height=386)
outputwindow.place(x=6,y=6, height=386, width=370)
EntryBox.place(x=128, y=401, height=90, width=265)
SendButton.place(x=6, y=401, height=90)
base.mainloop()
Я пробовал другие программы для этой же цели, он работает нормально.Но здесь я не могу обработать, и я не могу найти проблему. (Я просто изучаю tkinter)