From 64edcc3283a75fb8e492173434624d522cd99321 Mon Sep 17 00:00:00 2001 From: Daniel L Date: Sat, 27 Oct 2018 18:10:28 -0700 Subject: [PATCH] bpo-35086: Fix tkinter docs A Simple Hello World Program Application class does not hold onto the master Tk() instance as a class attribute. --- Doc/library/tkinter.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index d9c1c35aa294bd..bfb7ef969b1c8a 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -205,6 +205,7 @@ A Simple Hello World Program class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) + self.master = master self.pack() self.create_widgets() @@ -215,7 +216,7 @@ A Simple Hello World Program self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", - command=root.destroy) + command=self.master.destroy) self.quit.pack(side="bottom") def say_hi(self):