Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a3837a0d
Commit
a3837a0d
authored
Mar 22, 2004
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #911176: Move test function into __main__
parent
211a2eb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
Lib/lib-tk/SimpleDialog.py
Lib/lib-tk/SimpleDialog.py
+12
-12
No files found.
Lib/lib-tk/SimpleDialog.py
View file @
a3837a0d
...
@@ -86,10 +86,12 @@ class SimpleDialog:
...
@@ -86,10 +86,12 @@ class SimpleDialog:
self
.
root
.
quit
()
self
.
root
.
quit
()
def
test
():
if
__name__
==
'__main__'
:
root
=
Tk
()
def
doit
(
root
=
root
):
def
test
():
d
=
SimpleDialog
(
root
,
root
=
Tk
()
def
doit
(
root
=
root
):
d
=
SimpleDialog
(
root
,
text
=
"This is a test dialog. "
text
=
"This is a test dialog. "
"Would this have been an actual dialog, "
"Would this have been an actual dialog, "
"the buttons below would have been glowing "
"the buttons below would have been glowing "
...
@@ -99,13 +101,11 @@ def test():
...
@@ -99,13 +101,11 @@ def test():
default
=
0
,
default
=
0
,
cancel
=
2
,
cancel
=
2
,
title
=
"Test Dialog"
)
title
=
"Test Dialog"
)
print
d
.
go
()
print
d
.
go
()
t
=
Button
(
root
,
text
=
'Test'
,
command
=
doit
)
t
=
Button
(
root
,
text
=
'Test'
,
command
=
doit
)
t
.
pack
()
t
.
pack
()
q
=
Button
(
root
,
text
=
'Quit'
,
command
=
t
.
quit
)
q
=
Button
(
root
,
text
=
'Quit'
,
command
=
t
.
quit
)
q
.
pack
()
q
.
pack
()
t
.
mainloop
()
t
.
mainloop
()
if
__name__
==
'__main__'
:
test
()
test
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment