from tkinter import *

window = Tk()

window.title("Welcome to Tkinter!")
window.geometry('400x300+30+200')
window.configure(bg = "#8080F0")


# One label is a pure entry box description
lbl1 = Label(window, text="Enter name:")
lbl1.grid(column=0, row=0)

# The other label presents the result of actions
lbl2 = Label(window, text="            ")
lbl2.grid(column=2, row=1)


def entryEnter(event):
    atext = "Hello, " + txtEntry.get() + "!"
    lbl2.configure(text = atext)

def clickedBtn():
    atext = "Hello, " + txtEntry.get() + "!"
    lbl2.configure(text = atext)


txtEntry = Entry(window, width=20)
txtEntry.grid(column=1, row=0)
txtEntry.bind('<Return>', entryEnter)

btn = Button(window, text="Make Greeting", command=clickedBtn)
btn.grid(column=2, row=0)


window.mainloop()
