Nov-13-2021, 11:12 AM
(This post was last modified: Nov-13-2021, 11:24 AM by Yoriz.
Edit Reason: Added code tags
)
Hi,
It looks like the click event does not get called and so textbox2 does not get populated with the value of textbox1.
Do you see why?
Thank you
It looks like the click event does not get called and so textbox2 does not get populated with the value of textbox1.
Do you see why?
Thank you
from tkinter import * def click(): name = textbox1.get() message = str("Hello " + name) textbox2["text"] = message window = Tk() window.title("Names") window.geometry("450x350") window.configure(background="black") label1 = Label(text="Enter your name:") label1.place(x=30, y=200) label1["bg"] = "black" label1["fg"] = "white" textbox1 = Entry(text = "") textbox1.place(x=150, y=200, width=200, height=25) textbox1["justify"] = "center" textbox1.focus() button1 = Button(text="Press me", command=click) button1.place(x=30, y=250, width=120, height=25) button1["bg"] = "yellow" textbox2 = Entry(text="") textbox2.place(x=150, y=250, width=200, height=25) textbox2["bg"] = "white" textbox2["fg"] = "black" window.mainloop()