##########################################################################################
# Create a Tkinter screen with label, Text field and button
##########################################################################################
from tkinter import *			            #import entire tkinter framework
from tkinter import messagebox              #import popup dialogs 

def submitEvent( ):                                             #method is called upon submit
    comment = commentField.get('1.0',END)                       #get value entered in Text field                      
    messagebox.showinfo('Thanks', F"You enetered: {comment}")    #display a popup dialog
     
#### Create the window components ###########################################################

win = Tk( )					                    #call Tk( ) constructor to create a root window
win.title("Tkinter Window with Text field")	    #set a window title
win.geometry("460x200")                         #window size

#frame1 = Frame( win, bg='cyan', bd=20, highlightthickness=2, highlightbackground="blue")
frame1 = Frame( win, bg='cyan', bd=20)

commentLabel = Label(frame1, text="Enter your comments", bg="cyan")
commentField = Text( frame1, width=28, height=5)

submitButton = Button(frame1, width=9, text="Submit", cursor='hand2', command=submitEvent)  #call submitEvent upon submit

#### Place components in window ###########################################################

commentLabel.grid(row=0, column=0, pady=6, padx=5, sticky=NE)
commentField.grid(row=0, column=1, pady=6, padx=5)
submitButton.grid(row=1, column=1, padx=5, pady=8, sticky=W)

frame1.pack()                                                       #make the frame visible
win.mainloop()                                                      #make the window visible