# Code written by Honest Abe.
# stackoverflow.com/questions/3352918/how-to-center-a-window-on-the-screen-in-tkinter
def centerWindow(win):
    win.update_idletasks()
    width = win.winfo_width()
    height = win.winfo_height()
    x = (win.winfo_screenwidth() // 2) - (width // 2)
    y = (win.winfo_screenheight() // 2) - (height // 2)
    win.geometry('{}x{}+{}+{}'.format(width, height, x, y))
