File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,10 +86,12 @@ def done(self, num):
8686 self .root .quit ()
8787
8888
89- def test ():
90- root = Tk ()
91- def doit (root = root ):
92- d = SimpleDialog (root ,
89+ if __name__ == '__main__' :
90+
91+ def test ():
92+ root = Tk ()
93+ def doit (root = root ):
94+ d = SimpleDialog (root ,
9395 text = "This is a test dialog. "
9496 "Would this have been an actual dialog, "
9597 "the buttons below would have been glowing "
@@ -99,13 +101,11 @@ def doit(root=root):
99101 default = 0 ,
100102 cancel = 2 ,
101103 title = "Test Dialog" )
102- print d .go ()
103- t = Button (root , text = 'Test' , command = doit )
104- t .pack ()
105- q = Button (root , text = 'Quit' , command = t .quit )
106- q .pack ()
107- t .mainloop ()
104+ print d .go ()
105+ t = Button (root , text = 'Test' , command = doit )
106+ t .pack ()
107+ q = Button (root , text = 'Quit' , command = t .quit )
108+ q .pack ()
109+ t .mainloop ()
108110
109-
110- if __name__ == '__main__' :
111111 test ()
You can’t perform that action at this time.
0 commit comments