summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-10-30 15:35:02 (GMT)
committerGitHub <noreply@github.com>2018-10-30 15:35:02 (GMT)
commitc843a47007293d8361d0bfd45bfd7169afaa601c (patch)
treeba9af7701345e840b1e56a83f4d74afcc44a7fbc /Doc/library
parent47a2824850e7f9d6d69abe9ef12caa053411221c (diff)
downloadcpython-c843a47007293d8361d0bfd45bfd7169afaa601c.zip
cpython-c843a47007293d8361d0bfd45bfd7169afaa601c.tar.gz
cpython-c843a47007293d8361d0bfd45bfd7169afaa601c.tar.bz2
bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)
The root widget was accessed as a global variable in the Application's method. (cherry picked from commit a80af770870937271865b5e2b05a2cfe40b024b6) Co-authored-by: Daniel Lovell <lovell.daniel92@gmail.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/tkinter.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index 4af4b73..60cf892 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):