# L-30 MCS 260 Mon 28 Mar 2016 : guihello2.py
"""
Hello world with a Graphical User Interface.
After displaying "Who's there?", the user
can type in a name, and after pressing the
enter button, a new window will pop up,
displaying hello followed by the name.
"""
from tkinter import Tk, Entry, Label, Button
from tkinter import messagebox

TOP = Tk()
Label(TOP, text="Who's there ? ").grid(row=0)
ENT = Entry(TOP)
ENT.grid(row=0, column=1)

def hello():
    "opens a window to say hello"
    data = 'hello ' + ENT.get()
    messagebox.showinfo("enter", data)

BTT = Button(TOP, text="enter", command=hello)
BTT.grid(row=1, column=1)
TOP.mainloop()
