I am trying to create a dialog box in Python using Tkinter. The goal is to have a dialog box with two radio buttons and an \"OK\" button. Radio button one selects the opti
Instead of directly using master.quit
in the Button's command, define a function that finishes up the program then calls master.quit()
:
def end_program(event=None):#event will let it be used as .bind callbacks too if you need it.
selection = var.get()
if selection:
NotImplemented
else:
NotImplemented
master.quit()
...
Button(master, text = "OK", command = end_program).grid(row=3, sticky=W)
one the master is closed some of the data from the widgets is cleaned up so master.quit()
needs to be called only after you are done accessing the widgets.