Skip to content

Commit

Permalink
bpo-35086: Fix tkinter example "A Simple Hello World Program". (pytho…
Browse files Browse the repository at this point in the history
…nGH-10160)

The root widget was accessed as a global variable in the Application's method.
  • Loading branch information
daniellovell authored and serhiy-storchaka committed Oct 30, 2018
1 parent 31368a4 commit a80af77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/library/tkinter.rst
Expand Up @@ -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()

Expand All @@ -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):
Expand Down

0 comments on commit a80af77

Please sign in to comment.