def on_closing(): if msg.askokcancel("Warning", "Do you want to quit?"): background.destroy() rospy.signal_shutdown("")