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

def submitEvent( ):                                                 #method is called upon submit
    messagebox.showinfo('Info','This is informational only')        #display info (OK button)
    messagebox.showwarning('Warning','This is a warning')           #display warning (OK button)
    messagebox.showerror('Error','This is an error')                #display error (OK button)
    resp1 = messagebox.askquestion('Yes or No','Choose yes or No')          #display Yes/No buttons
    resp2 = messagebox.askyesno('Yes or No','Choose yes or No')             #display Yes/No buttons
    resp3 = messagebox.askokcancel('OK or Cancel','Choose OK or Cancel')    #display OK or Cancel buttons
    resp4 = messagebox.askretrycancel('Retry or Cancel','Retry or Cancel')  #display Retry or Cancel buttons
    messagebox.showinfo('Info',F'You chose: {resp1} {resp2} {resp3} {resp4}')
 
#### Create the window components ###########################################################

win = Tk( )					                    #call Tk( ) constructor to create a root window
win.title("Tkinter Window showing dialogs")	    #set a window title
win.geometry("200x100")                         #window size

frame1 = Frame(win)

nameLabel    = Label(frame1, text="Display all popup dialogs ")                       #create components

submitButton = Button(frame1, width=9, text="Let's Start", command=submitEvent)  #call submit method upon submit

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

nameLabel.grid(   row=0,column=0, ipadx=5,ipady=10)         #with internal x/y padding
submitButton.grid(row=1,column=0, sticky='nesw')            #nesw = north/east/south/west

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