]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
simplified no Tk() sets _default_root
authorGuido van Rossum <guido@python.org>
Thu, 7 Sep 1995 19:45:52 +0000 (19:45 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 7 Sep 1995 19:45:52 +0000 (19:45 +0000)
Demo/tkinter/guido/imageview.py

index 541c96adeab33bb0748edf80a5c9a4a2e41b530f..d6efed0b2bb83eb7bcb9fbfde714fdbbb43309b9 100755 (executable)
@@ -4,9 +4,8 @@ import sys
 def main():
     filename = sys.argv[1]
     root = Tk()
-    label = Label(root)
     img = PhotoImage(file=filename)
-    label['image'] = img
+    label = Label(root, image=img)
     label.pack()
     root.mainloop()