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
14fc4270
Commit
14fc4270
authored
May 17, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tkinter, step 2: adapt imports.
parent
33023123
Changes
50
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
136 additions
and
133 deletions
+136
-133
Lib/idlelib/AutoCompleteWindow.py
Lib/idlelib/AutoCompleteWindow.py
+1
-1
Lib/idlelib/CallTipWindow.py
Lib/idlelib/CallTipWindow.py
+1
-1
Lib/idlelib/CodeContext.py
Lib/idlelib/CodeContext.py
+3
-3
Lib/idlelib/ColorDelegator.py
Lib/idlelib/ColorDelegator.py
+1
-1
Lib/idlelib/Debugger.py
Lib/idlelib/Debugger.py
+1
-1
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+3
-3
Lib/idlelib/FileList.py
Lib/idlelib/FileList.py
+2
-2
Lib/idlelib/GrepDialog.py
Lib/idlelib/GrepDialog.py
+1
-1
Lib/idlelib/IOBinding.py
Lib/idlelib/IOBinding.py
+4
-4
Lib/idlelib/MultiCall.py
Lib/idlelib/MultiCall.py
+4
-4
Lib/idlelib/MultiStatusBar.py
Lib/idlelib/MultiStatusBar.py
+1
-1
Lib/idlelib/ObjectBrowser.py
Lib/idlelib/ObjectBrowser.py
+1
-1
Lib/idlelib/OutputWindow.py
Lib/idlelib/OutputWindow.py
+2
-2
Lib/idlelib/Percolator.py
Lib/idlelib/Percolator.py
+1
-1
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+4
-4
Lib/idlelib/ReplaceDialog.py
Lib/idlelib/ReplaceDialog.py
+1
-1
Lib/idlelib/ScriptBinding.py
Lib/idlelib/ScriptBinding.py
+1
-1
Lib/idlelib/ScrolledList.py
Lib/idlelib/ScrolledList.py
+1
-1
Lib/idlelib/SearchDialog.py
Lib/idlelib/SearchDialog.py
+1
-1
Lib/idlelib/SearchDialogBase.py
Lib/idlelib/SearchDialogBase.py
+1
-1
Lib/idlelib/SearchEngine.py
Lib/idlelib/SearchEngine.py
+2
-2
Lib/idlelib/StackViewer.py
Lib/idlelib/StackViewer.py
+1
-1
Lib/idlelib/ToolTip.py
Lib/idlelib/ToolTip.py
+1
-1
Lib/idlelib/TreeWidget.py
Lib/idlelib/TreeWidget.py
+1
-1
Lib/idlelib/UndoDelegator.py
Lib/idlelib/UndoDelegator.py
+1
-1
Lib/idlelib/WidgetRedirector.py
Lib/idlelib/WidgetRedirector.py
+1
-1
Lib/idlelib/WindowList.py
Lib/idlelib/WindowList.py
+1
-1
Lib/idlelib/aboutDialog.py
Lib/idlelib/aboutDialog.py
+1
-1
Lib/idlelib/configDialog.py
Lib/idlelib/configDialog.py
+4
-2
Lib/idlelib/configHelpSourceEdit.py
Lib/idlelib/configHelpSourceEdit.py
+3
-3
Lib/idlelib/configSectionNameDialog.py
Lib/idlelib/configSectionNameDialog.py
+2
-2
Lib/idlelib/dynOptionMenuWidget.py
Lib/idlelib/dynOptionMenuWidget.py
+2
-2
Lib/idlelib/keybindingDialog.py
Lib/idlelib/keybindingDialog.py
+2
-2
Lib/idlelib/macosxSupport.py
Lib/idlelib/macosxSupport.py
+3
-3
Lib/idlelib/run.py
Lib/idlelib/run.py
+3
-3
Lib/idlelib/tabbedpages.py
Lib/idlelib/tabbedpages.py
+1
-1
Lib/idlelib/textView.py
Lib/idlelib/textView.py
+3
-3
Lib/pydoc.py
Lib/pydoc.py
+16
-16
Lib/tkinter/__init__.py
Lib/tkinter/__init__.py
+10
-10
Lib/tkinter/colorchooser.py
Lib/tkinter/colorchooser.py
+1
-1
Lib/tkinter/commondialog.py
Lib/tkinter/commondialog.py
+3
-3
Lib/tkinter/dialog.py
Lib/tkinter/dialog.py
+3
-3
Lib/tkinter/dnd.py
Lib/tkinter/dnd.py
+6
-6
Lib/tkinter/filedialog.py
Lib/tkinter/filedialog.py
+2
-2
Lib/tkinter/font.py
Lib/tkinter/font.py
+10
-9
Lib/tkinter/messagebox.py
Lib/tkinter/messagebox.py
+1
-1
Lib/tkinter/scrolledtext.py
Lib/tkinter/scrolledtext.py
+2
-2
Lib/tkinter/simpledialog.py
Lib/tkinter/simpledialog.py
+1
-1
Lib/tkinter/tix.py
Lib/tkinter/tix.py
+9
-9
Lib/tkinter/turtle.py
Lib/tkinter/turtle.py
+5
-5
No files found.
Lib/idlelib/AutoCompleteWindow.py
View file @
14fc4270
"""
"""
An auto-completion window for IDLE, used by the AutoComplete extension
An auto-completion window for IDLE, used by the AutoComplete extension
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib.MultiCall
import
MC_SHIFT
from
idlelib.MultiCall
import
MC_SHIFT
from
idlelib.AutoComplete
import
COMPLETE_FILES
,
COMPLETE_ATTRIBUTES
from
idlelib.AutoComplete
import
COMPLETE_FILES
,
COMPLETE_ATTRIBUTES
...
...
Lib/idlelib/CallTipWindow.py
View file @
14fc4270
...
@@ -4,7 +4,7 @@ After ToolTip.py, which uses ideas gleaned from PySol
...
@@ -4,7 +4,7 @@ After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension.
Used by the CallTips IDLE extension.
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
HIDE_VIRTUAL_EVENT_NAME
=
"<<calltipwindow-hide>>"
HIDE_VIRTUAL_EVENT_NAME
=
"<<calltipwindow-hide>>"
HIDE_SEQUENCES
=
(
"<Key-Escape>"
,
"<FocusOut>"
)
HIDE_SEQUENCES
=
(
"<Key-Escape>"
,
"<FocusOut>"
)
...
...
Lib/idlelib/CodeContext.py
View file @
14fc4270
...
@@ -9,8 +9,8 @@ variable in the CodeContext section of config-extensions.def. Lines which do
...
@@ -9,8 +9,8 @@ variable in the CodeContext section of config-extensions.def. Lines which do
not open blocks are not shown in the context hints pane.
not open blocks are not shown in the context hints pane.
"""
"""
import
T
kinter
import
t
kinter
from
Tk
constants
import
TOP
,
LEFT
,
X
,
W
,
SUNKEN
from
tkinter.
constants
import
TOP
,
LEFT
,
X
,
W
,
SUNKEN
import
re
import
re
from
sys
import
maxsize
as
INFINITY
from
sys
import
maxsize
as
INFINITY
from
idlelib.configHandler
import
idleConf
from
idlelib.configHandler
import
idleConf
...
@@ -69,7 +69,7 @@ class CodeContext:
...
@@ -69,7 +69,7 @@ class CodeContext:
border
=
0
border
=
0
for
widget
in
widgets
:
for
widget
in
widgets
:
border
+=
int
(
str
(
widget
.
cget
(
'border'
)
))
border
+=
int
(
str
(
widget
.
cget
(
'border'
)
))
self
.
label
=
T
kinter
.
Label
(
self
.
editwin
.
top
,
self
.
label
=
t
kinter
.
Label
(
self
.
editwin
.
top
,
text
=
"
\
n
"
*
(
self
.
context_depth
-
1
),
text
=
"
\
n
"
*
(
self
.
context_depth
-
1
),
anchor
=
W
,
justify
=
LEFT
,
anchor
=
W
,
justify
=
LEFT
,
font
=
self
.
textfont
,
font
=
self
.
textfont
,
...
...
Lib/idlelib/ColorDelegator.py
View file @
14fc4270
...
@@ -2,7 +2,7 @@ import time
...
@@ -2,7 +2,7 @@ import time
import
re
import
re
import
keyword
import
keyword
import
builtins
import
builtins
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib.Delegator
import
Delegator
from
idlelib.Delegator
import
Delegator
from
idlelib.configHandler
import
idleConf
from
idlelib.configHandler
import
idleConf
...
...
Lib/idlelib/Debugger.py
View file @
14fc4270
import
os
import
os
import
bdb
import
bdb
import
types
import
types
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib.WindowList
import
ListedToplevel
from
idlelib.WindowList
import
ListedToplevel
from
idlelib.ScrolledList
import
ScrolledList
from
idlelib.ScrolledList
import
ScrolledList
from
idlelib
import
macosxSupport
from
idlelib
import
macosxSupport
...
...
Lib/idlelib/EditorWindow.py
View file @
14fc4270
...
@@ -4,9 +4,9 @@ import re
...
@@ -4,9 +4,9 @@ import re
import
string
import
string
import
imp
import
imp
from
itertools
import
count
from
itertools
import
count
from
T
kinter
import
*
from
t
kinter
import
*
import
tkSimpleDialog
import
tk
inter.simpledialog
as
tk
SimpleDialog
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
import
traceback
import
traceback
import
webbrowser
import
webbrowser
...
...
Lib/idlelib/FileList.py
View file @
14fc4270
import
os
import
os
from
T
kinter
import
*
from
t
kinter
import
*
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
class
FileList
:
class
FileList
:
...
...
Lib/idlelib/GrepDialog.py
View file @
14fc4270
import
os
import
os
import
fnmatch
import
fnmatch
import
sys
import
sys
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib
import
SearchEngine
from
idlelib
import
SearchEngine
from
idlelib.SearchDialogBase
import
SearchDialogBase
from
idlelib.SearchDialogBase
import
SearchDialogBase
...
...
Lib/idlelib/IOBinding.py
View file @
14fc4270
...
@@ -3,11 +3,11 @@ import types
...
@@ -3,11 +3,11 @@ import types
import
sys
import
sys
import
codecs
import
codecs
import
tempfile
import
tempfile
import
tkFileDialog
import
tk
inter.filedialog
as
tk
FileDialog
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
import
re
import
re
from
T
kinter
import
*
from
t
kinter
import
*
from
SimpleD
ialog
import
SimpleDialog
from
tkinter.simpled
ialog
import
SimpleDialog
from
idlelib.configHandler
import
idleConf
from
idlelib.configHandler
import
idleConf
...
...
Lib/idlelib/MultiCall.py
View file @
14fc4270
...
@@ -31,7 +31,7 @@ Each function will be called at most once for each event.
...
@@ -31,7 +31,7 @@ Each function will be called at most once for each event.
import
sys
import
sys
import
re
import
re
import
T
kinter
import
t
kinter
# the event type constants, which define the meaning of mc_type
# the event type constants, which define the meaning of mc_type
MC_KEYPRESS
=
0
;
MC_KEYRELEASE
=
1
;
MC_BUTTONPRESS
=
2
;
MC_BUTTONRELEASE
=
3
;
MC_KEYPRESS
=
0
;
MC_KEYRELEASE
=
1
;
MC_BUTTONPRESS
=
2
;
MC_BUTTONRELEASE
=
3
;
...
@@ -304,7 +304,7 @@ def MultiCallCreator(widget):
...
@@ -304,7 +304,7 @@ def MultiCallCreator(widget):
return _multicall_dict[widget]
return _multicall_dict[widget]
class MultiCall (widget):
class MultiCall (widget):
assert issubclass(widget,
T
kinter.Misc)
assert issubclass(widget,
t
kinter.Misc)
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs):
widget.__init__(self, *args, **kwargs)
widget.__init__(self, *args, **kwargs)
...
@@ -396,8 +396,8 @@ def MultiCallCreator(widget):
...
@@ -396,8 +396,8 @@ def MultiCallCreator(widget):
if __name__ == "
__main__
":
if __name__ == "
__main__
":
# Test
# Test
root =
T
kinter.Tk()
root =
t
kinter.Tk()
text = MultiCallCreator(
T
kinter.Text)(root)
text = MultiCallCreator(
t
kinter.Text)(root)
text.pack()
text.pack()
def bindseq(seq, n=[0]):
def bindseq(seq, n=[0]):
def handler(event):
def handler(event):
...
...
Lib/idlelib/MultiStatusBar.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
class
MultiStatusBar
(
Frame
):
class
MultiStatusBar
(
Frame
):
...
...
Lib/idlelib/ObjectBrowser.py
View file @
14fc4270
...
@@ -123,7 +123,7 @@ def make_objecttreeitem(labeltext, object, setfunction=None):
...
@@ -123,7 +123,7 @@ def make_objecttreeitem(labeltext, object, setfunction=None):
def
_test
():
def
_test
():
import
sys
import
sys
from
T
kinter
import
Tk
from
t
kinter
import
Tk
root
=
Tk
()
root
=
Tk
()
root
.
configure
(
bd
=
0
,
bg
=
"yellow"
)
root
.
configure
(
bd
=
0
,
bg
=
"yellow"
)
root
.
focus_set
()
root
.
focus_set
()
...
...
Lib/idlelib/OutputWindow.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib.EditorWindow
import
EditorWindow
from
idlelib.EditorWindow
import
EditorWindow
import
re
import
re
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
from
idlelib
import
IOBinding
from
idlelib
import
IOBinding
class
OutputWindow
(
EditorWindow
):
class
OutputWindow
(
EditorWindow
):
...
...
Lib/idlelib/Percolator.py
View file @
14fc4270
...
@@ -52,7 +52,7 @@ class Percolator:
...
@@ -52,7 +52,7 @@ class Percolator:
filter
.
setdelegate
(
None
)
filter
.
setdelegate
(
None
)
def
main
():
def
main
():
import
T
kinter
as
Tk
import
t
kinter
as
Tk
class
Tracer
(
Delegator
):
class
Tracer
(
Delegator
):
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
name
=
name
...
...
Lib/idlelib/PyShell.py
View file @
14fc4270
...
@@ -15,12 +15,12 @@ import linecache
...
@@ -15,12 +15,12 @@ import linecache
from
code
import
InteractiveInterpreter
from
code
import
InteractiveInterpreter
try
:
try
:
from
T
kinter
import
*
from
t
kinter
import
*
except
ImportError
:
except
ImportError
:
print
(
"** IDLE can't import Tkinter. "
\
print
(
"** IDLE can't import Tkinter. "
\
"Your Python may not be configured for Tk. **"
,
file
=
sys
.
__stderr__
)
"Your Python may not be configured for Tk. **"
,
file
=
sys
.
__stderr__
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
from
idlelib.EditorWindow
import
EditorWindow
,
fixwordbreaks
from
idlelib.EditorWindow
import
EditorWindow
,
fixwordbreaks
from
idlelib.FileList
import
FileList
from
idlelib.FileList
import
FileList
...
@@ -983,8 +983,8 @@ class PyShell(OutputWindow):
...
@@ -983,8 +983,8 @@ class PyShell(OutputWindow):
(
sys
.
version
,
sys
.
platform
,
self
.
COPYRIGHT
,
(
sys
.
version
,
sys
.
platform
,
self
.
COPYRIGHT
,
self
.
firewallmessage
,
idlever
.
IDLE_VERSION
,
nosub
))
self
.
firewallmessage
,
idlever
.
IDLE_VERSION
,
nosub
))
self
.
showprompt
()
self
.
showprompt
()
import
T
kinter
import
t
kinter
T
kinter
.
_default_root
=
None
# 03Jan04 KBK What's this?
t
kinter
.
_default_root
=
None
# 03Jan04 KBK What's this?
return
True
return
True
def
readline
(
self
):
def
readline
(
self
):
...
...
Lib/idlelib/ReplaceDialog.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib
import
SearchEngine
from
idlelib
import
SearchEngine
from
idlelib.SearchDialogBase
import
SearchDialogBase
from
idlelib.SearchDialogBase
import
SearchDialogBase
...
...
Lib/idlelib/ScriptBinding.py
View file @
14fc4270
...
@@ -22,7 +22,7 @@ import re
...
@@ -22,7 +22,7 @@ import re
import
string
import
string
import
tabnanny
import
tabnanny
import
tokenize
import
tokenize
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
from
idlelib.EditorWindow
import
EditorWindow
from
idlelib.EditorWindow
import
EditorWindow
from
idlelib
import
PyShell
from
idlelib
import
PyShell
...
...
Lib/idlelib/ScrolledList.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
class
ScrolledList
:
class
ScrolledList
:
...
...
Lib/idlelib/SearchDialog.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib
import
SearchEngine
from
idlelib
import
SearchEngine
from
idlelib.SearchDialogBase
import
SearchDialogBase
from
idlelib.SearchDialogBase
import
SearchDialogBase
...
...
Lib/idlelib/SearchDialogBase.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
class
SearchDialogBase
:
class
SearchDialogBase
:
...
...
Lib/idlelib/SearchEngine.py
View file @
14fc4270
import
re
import
re
from
T
kinter
import
*
from
t
kinter
import
*
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
def
get
(
root
):
def
get
(
root
):
if
not
hasattr
(
root
,
"_searchengine"
):
if
not
hasattr
(
root
,
"_searchengine"
):
...
...
Lib/idlelib/StackViewer.py
View file @
14fc4270
...
@@ -7,7 +7,7 @@ from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
...
@@ -7,7 +7,7 @@ from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem
def
StackBrowser
(
root
,
flist
=
None
,
tb
=
None
,
top
=
None
):
def
StackBrowser
(
root
,
flist
=
None
,
tb
=
None
,
top
=
None
):
if
top
is
None
:
if
top
is
None
:
from
T
kinter
import
Toplevel
from
t
kinter
import
Toplevel
top
=
Toplevel
(
root
)
top
=
Toplevel
(
root
)
sc
=
ScrolledCanvas
(
top
,
bg
=
"white"
,
highlightthickness
=
0
)
sc
=
ScrolledCanvas
(
top
,
bg
=
"white"
,
highlightthickness
=
0
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
)
...
...
Lib/idlelib/ToolTip.py
View file @
14fc4270
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# may be useful for some purposes in (or almost in ;) the current project scope
# may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol
# Ideas gleaned from PySol
from
T
kinter
import
*
from
t
kinter
import
*
class
ToolTipBase
:
class
ToolTipBase
:
...
...
Lib/idlelib/TreeWidget.py
View file @
14fc4270
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
# - optimize tree redraw after expand of subnode
# - optimize tree redraw after expand of subnode
import
os
import
os
from
T
kinter
import
*
from
t
kinter
import
*
import
imp
import
imp
from
idlelib
import
ZoomHeight
from
idlelib
import
ZoomHeight
...
...
Lib/idlelib/UndoDelegator.py
View file @
14fc4270
import
string
import
string
from
T
kinter
import
*
from
t
kinter
import
*
from
idlelib.Delegator
import
Delegator
from
idlelib.Delegator
import
Delegator
...
...
Lib/idlelib/WidgetRedirector.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
class
WidgetRedirector
:
class
WidgetRedirector
:
...
...
Lib/idlelib/WindowList.py
View file @
14fc4270
from
T
kinter
import
*
from
t
kinter
import
*
class
WindowList
:
class
WindowList
:
...
...
Lib/idlelib/aboutDialog.py
View file @
14fc4270
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
import
os
import
os
from
idlelib
import
textView
from
idlelib
import
textView
...
...
Lib/idlelib/configDialog.py
View file @
14fc4270
...
@@ -9,8 +9,10 @@ Note that tab width in IDLE is currently fixed at eight due to Tk issues.
...
@@ -9,8 +9,10 @@ Note that tab width in IDLE is currently fixed at eight due to Tk issues.
Refer to comments in EditorWindow autoindent code for details.
Refer to comments in EditorWindow autoindent code for details.
"""
"""
from
Tkinter
import
*
from
tkinter
import
*
import
tkMessageBox
,
tkColorChooser
,
tkFont
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.colorchooser
as
tkColorChooser
import
tkinter.font
as
tkFont
import
copy
import
copy
from
idlelib.configHandler
import
idleConf
from
idlelib.configHandler
import
idleConf
...
...
Lib/idlelib/configHelpSourceEdit.py
View file @
14fc4270
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
import
os
import
os
import
sys
import
sys
from
T
kinter
import
*
from
t
kinter
import
*
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
import
tkFileDialog
import
tk
inter.filedialog
as
tk
FileDialog
class
GetHelpSourceDialog
(
Toplevel
):
class
GetHelpSourceDialog
(
Toplevel
):
def
__init__
(
self
,
parent
,
title
,
menuItem
=
''
,
filePath
=
''
):
def
__init__
(
self
,
parent
,
title
,
menuItem
=
''
,
filePath
=
''
):
...
...
Lib/idlelib/configSectionNameDialog.py
View file @
14fc4270
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
Dialog that allows user to specify a new config file section name.
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
Used to get new highlight theme and keybinding set names.
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
class
GetCfgSectionNameDialog
(
Toplevel
):
class
GetCfgSectionNameDialog
(
Toplevel
):
def
__init__
(
self
,
parent
,
title
,
message
,
usedNames
):
def
__init__
(
self
,
parent
,
title
,
message
,
usedNames
):
...
...
Lib/idlelib/dynOptionMenuWidget.py
View file @
14fc4270
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
OptionMenu widget modified to allow dynamic menu reconfiguration
OptionMenu widget modified to allow dynamic menu reconfiguration
and setting of highlightthickness
and setting of highlightthickness
"""
"""
from
T
kinter
import
OptionMenu
from
t
kinter
import
OptionMenu
from
T
kinter
import
_setit
from
t
kinter
import
_setit
import
copy
import
copy
class
DynOptionMenu
(
OptionMenu
):
class
DynOptionMenu
(
OptionMenu
):
...
...
Lib/idlelib/keybindingDialog.py
View file @
14fc4270
"""
"""
Dialog for building Tkinter accelerator key bindings
Dialog for building Tkinter accelerator key bindings
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
import
string
import
string
class
GetKeysDialog
(
Toplevel
):
class
GetKeysDialog
(
Toplevel
):
...
...
Lib/idlelib/macosxSupport.py
View file @
14fc4270
...
@@ -3,7 +3,7 @@ A number of function that enhance IDLE on MacOSX when it used as a normal
...
@@ -3,7 +3,7 @@ A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
GUI application (as opposed to an X11 application).
"""
"""
import
sys
import
sys
import
T
kinter
import
t
kinter
def
runningAsOSXApp
():
def
runningAsOSXApp
():
""" Returns True iff running from the IDLE.app bundle on OSX """
""" Returns True iff running from the IDLE.app bundle on OSX """
...
@@ -26,7 +26,7 @@ def addOpenEventSupport(root, flist):
...
@@ -26,7 +26,7 @@ def addOpenEventSupport(root, flist):
def
hideTkConsole
(
root
):
def
hideTkConsole
(
root
):
try
:
try
:
root
.
tk
.
call
(
'console'
,
'hide'
)
root
.
tk
.
call
(
'console'
,
'hide'
)
except
T
kinter
.
TclError
:
except
t
kinter
.
TclError
:
# Some versions of the Tk framework don't have a console object
# Some versions of the Tk framework don't have a console object
pass
pass
...
@@ -46,7 +46,7 @@ def overrideRootMenu(root, flist):
...
@@ -46,7 +46,7 @@ def overrideRootMenu(root, flist):
#
#
# Due to a (mis-)feature of TkAqua the user will also see an empty Help
# Due to a (mis-)feature of TkAqua the user will also see an empty Help
# menu.
# menu.
from
T
kinter
import
Menu
,
Text
,
Text
from
t
kinter
import
Menu
,
Text
,
Text
from
idlelib.EditorWindow
import
prepstr
,
get_accelerator
from
idlelib.EditorWindow
import
prepstr
,
get_accelerator
from
idlelib
import
Bindings
from
idlelib
import
Bindings
from
idlelib
import
WindowList
from
idlelib
import
WindowList
...
...
Lib/idlelib/run.py
View file @
14fc4270
...
@@ -127,9 +127,9 @@ def manage_socket(address):
...
@@ -127,9 +127,9 @@ def manage_socket(address):
server
.
handle_request
()
# A single request only
server
.
handle_request
()
# A single request only
def
show_socket_error
(
err
,
address
):
def
show_socket_error
(
err
,
address
):
import
T
kinter
import
t
kinter
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
root
=
T
kinter
.
Tk
()
root
=
t
kinter
.
Tk
()
root
.
withdraw
()
root
.
withdraw
()
if
err
.
args
[
0
]
==
61
:
# connection refused
if
err
.
args
[
0
]
==
61
:
# connection refused
msg
=
"IDLE's subprocess can't connect to %s:%d. This may be due "
\
msg
=
"IDLE's subprocess can't connect to %s:%d. This may be due "
\
...
...
Lib/idlelib/tabbedpages.py
View file @
14fc4270
...
@@ -7,7 +7,7 @@ TabbedPageSet -- A Tkinter implementation of a tabbed-page widget.
...
@@ -7,7 +7,7 @@ TabbedPageSet -- A Tkinter implementation of a tabbed-page widget.
TabSet -- A widget containing tabs (buttons) in one or more rows.
TabSet -- A widget containing tabs (buttons) in one or more rows.
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
class
InvalidNameError
(
Exception
):
pass
class
InvalidNameError
(
Exception
):
pass
class
AlreadyExistsError
(
Exception
):
pass
class
AlreadyExistsError
(
Exception
):
pass
...
...
Lib/idlelib/textView.py
View file @
14fc4270
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
class
TextViewer
(
Toplevel
):
class
TextViewer
(
Toplevel
):
"""A simple text viewer dialog for IDLE
"""A simple text viewer dialog for IDLE
...
@@ -68,7 +68,7 @@ def view_file(parent, title, filename, encoding=None):
...
@@ -68,7 +68,7 @@ def view_file(parent, title, filename, encoding=None):
else
:
else
:
textFile
=
open
(
filename
,
'r'
)
textFile
=
open
(
filename
,
'r'
)
except
IOError
:
except
IOError
:
import
tkMessageBox
import
tk
inter.messagebox
as
tk
MessageBox
tkMessageBox
.
showerror
(
title
=
'File Load Error'
,
tkMessageBox
.
showerror
(
title
=
'File Load Error'
,
message
=
'Unable to load file %r .'
%
filename
,
message
=
'Unable to load file %r .'
%
filename
,
parent
=
parent
)
parent
=
parent
)
...
...
Lib/pydoc.py
View file @
14fc4270
...
@@ -2018,20 +2018,20 @@ def gui():
...
@@ -2018,20 +2018,20 @@ def gui():
self
.
server
=
None
self
.
server
=
None
self
.
scanner
=
None
self
.
scanner
=
None
import
T
kinter
import
t
kinter
self
.
server_frm
=
T
kinter
.
Frame
(
window
)
self
.
server_frm
=
t
kinter
.
Frame
(
window
)
self
.
title_lbl
=
T
kinter
.
Label
(
self
.
server_frm
,
self
.
title_lbl
=
t
kinter
.
Label
(
self
.
server_frm
,
text
=
'Starting server...
\
n
'
)
text
=
'Starting server...
\
n
'
)
self
.
open_btn
=
T
kinter
.
Button
(
self
.
server_frm
,
self
.
open_btn
=
t
kinter
.
Button
(
self
.
server_frm
,
text
=
'open browser'
,
command
=
self
.
open
,
state
=
'disabled'
)
text
=
'open browser'
,
command
=
self
.
open
,
state
=
'disabled'
)
self
.
quit_btn
=
T
kinter
.
Button
(
self
.
server_frm
,
self
.
quit_btn
=
t
kinter
.
Button
(
self
.
server_frm
,
text
=
'quit serving'
,
command
=
self
.
quit
,
state
=
'disabled'
)
text
=
'quit serving'
,
command
=
self
.
quit
,
state
=
'disabled'
)
self
.
search_frm
=
T
kinter
.
Frame
(
window
)
self
.
search_frm
=
t
kinter
.
Frame
(
window
)
self
.
search_lbl
=
T
kinter
.
Label
(
self
.
search_frm
,
text
=
'Search for'
)
self
.
search_lbl
=
t
kinter
.
Label
(
self
.
search_frm
,
text
=
'Search for'
)
self
.
search_ent
=
T
kinter
.
Entry
(
self
.
search_frm
)
self
.
search_ent
=
t
kinter
.
Entry
(
self
.
search_frm
)
self
.
search_ent
.
bind
(
'<Return>'
,
self
.
search
)
self
.
search_ent
.
bind
(
'<Return>'
,
self
.
search
)
self
.
stop_btn
=
T
kinter
.
Button
(
self
.
search_frm
,
self
.
stop_btn
=
t
kinter
.
Button
(
self
.
search_frm
,
text
=
'stop'
,
pady
=
0
,
command
=
self
.
stop
,
state
=
'disabled'
)
text
=
'stop'
,
pady
=
0
,
command
=
self
.
stop
,
state
=
'disabled'
)
if
sys
.
platform
==
'win32'
:
if
sys
.
platform
==
'win32'
:
# Trying to hide and show this button crashes under Windows.
# Trying to hide and show this button crashes under Windows.
...
@@ -2050,17 +2050,17 @@ def gui():
...
@@ -2050,17 +2050,17 @@ def gui():
self
.
search_ent
.
focus_set
()
self
.
search_ent
.
focus_set
()
font
=
(
'helvetica'
,
sys
.
platform
==
'win32'
and
8
or
10
)
font
=
(
'helvetica'
,
sys
.
platform
==
'win32'
and
8
or
10
)
self
.
result_lst
=
T
kinter
.
Listbox
(
window
,
font
=
font
,
height
=
6
)
self
.
result_lst
=
t
kinter
.
Listbox
(
window
,
font
=
font
,
height
=
6
)
self
.
result_lst
.
bind
(
'<Button-1>'
,
self
.
select
)
self
.
result_lst
.
bind
(
'<Button-1>'
,
self
.
select
)
self
.
result_lst
.
bind
(
'<Double-Button-1>'
,
self
.
goto
)
self
.
result_lst
.
bind
(
'<Double-Button-1>'
,
self
.
goto
)
self
.
result_scr
=
T
kinter
.
Scrollbar
(
window
,
self
.
result_scr
=
t
kinter
.
Scrollbar
(
window
,
orient
=
'vertical'
,
command
=
self
.
result_lst
.
yview
)
orient
=
'vertical'
,
command
=
self
.
result_lst
.
yview
)
self
.
result_lst
.
config
(
yscrollcommand
=
self
.
result_scr
.
set
)
self
.
result_lst
.
config
(
yscrollcommand
=
self
.
result_scr
.
set
)
self
.
result_frm
=
T
kinter
.
Frame
(
window
)
self
.
result_frm
=
t
kinter
.
Frame
(
window
)
self
.
goto_btn
=
T
kinter
.
Button
(
self
.
result_frm
,
self
.
goto_btn
=
t
kinter
.
Button
(
self
.
result_frm
,
text
=
'go to selected'
,
command
=
self
.
goto
)
text
=
'go to selected'
,
command
=
self
.
goto
)
self
.
hide_btn
=
T
kinter
.
Button
(
self
.
result_frm
,
self
.
hide_btn
=
t
kinter
.
Button
(
self
.
result_frm
,
text
=
'hide results'
,
command
=
self
.
hide
)
text
=
'hide results'
,
command
=
self
.
hide
)
self
.
goto_btn
.
pack
(
side
=
'left'
,
fill
=
'x'
,
expand
=
1
)
self
.
goto_btn
.
pack
(
side
=
'left'
,
fill
=
'x'
,
expand
=
1
)
self
.
hide_btn
.
pack
(
side
=
'right'
,
fill
=
'x'
,
expand
=
1
)
self
.
hide_btn
.
pack
(
side
=
'right'
,
fill
=
'x'
,
expand
=
1
)
...
@@ -2180,9 +2180,9 @@ def gui():
...
@@ -2180,9 +2180,9 @@ def gui():
self
.
stop
()
self
.
stop
()
self
.
collapse
()
self
.
collapse
()
import
T
kinter
import
t
kinter
try
:
try
:
root
=
T
kinter
.
Tk
()
root
=
t
kinter
.
Tk
()
# Tk will crash if pythonw.exe has an XP .manifest
# Tk will crash if pythonw.exe has an XP .manifest
# file and the root has is not destroyed explicitly.
# file and the root has is not destroyed explicitly.
# If the problem is ever fixed in Tk, the explicit
# If the problem is ever fixed in Tk, the explicit
...
...
Lib/tkinter/__init__.py
View file @
14fc4270
...
@@ -18,14 +18,14 @@ Actions are bound to events by resources (e.g. keyword argument
...
@@ -18,14 +18,14 @@ Actions are bound to events by resources (e.g. keyword argument
command) or with the method bind.
command) or with the method bind.
Example (Hello, World):
Example (Hello, World):
import
T
kinter
import
t
kinter
from
Tk
constants import *
from
tkinter.
constants import *
tk =
T
kinter.Tk()
tk =
t
kinter.Tk()
frame =
T
kinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame =
t
kinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
frame.pack(fill=BOTH,expand=1)
label =
T
kinter.Label(frame, text="Hello, World")
label =
t
kinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
label.pack(fill=X, expand=1)
button =
T
kinter.Button(frame,text="Exit",command=tk.destroy)
button =
t
kinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
button.pack(side=BOTTOM)
tk.mainloop()
tk.mainloop()
"""
"""
...
@@ -34,11 +34,11 @@ __version__ = "$Revision$"
...
@@ -34,11 +34,11 @@ __version__ = "$Revision$"
import
sys
import
sys
if
sys
.
platform
==
"win32"
:
if
sys
.
platform
==
"win32"
:
import
FixTk
# Attempt to configure Tcl/Tk without requiring PATH
# Attempt to configure Tcl/Tk without requiring PATH
from
tkinter
import
_fix
import
_tkinter
# If this fails your Python may not be configured for Tk
import
_tkinter
# If this fails your Python may not be configured for Tk
tkinter
=
_tkinter
# b/w compat for export
TclError
=
_tkinter
.
TclError
TclError
=
_tkinter
.
TclError
from
Tk
constants
import
*
from
tkinter.
constants
import
*
try
:
try
:
import
MacOS
;
_MacOS
=
MacOS
;
del
MacOS
import
MacOS
;
_MacOS
=
MacOS
;
del
MacOS
except
ImportError
:
except
ImportError
:
...
@@ -1692,7 +1692,7 @@ class Tk(Misc, Wm):
...
@@ -1692,7 +1692,7 @@ class Tk(Misc, Wm):
base_tcl
=
os
.
path
.
join
(
home
,
'.%s.tcl'
%
baseName
)
base_tcl
=
os
.
path
.
join
(
home
,
'.%s.tcl'
%
baseName
)
base_py
=
os
.
path
.
join
(
home
,
'.%s.py'
%
baseName
)
base_py
=
os
.
path
.
join
(
home
,
'.%s.py'
%
baseName
)
dir
=
{
'self'
:
self
}
dir
=
{
'self'
:
self
}
exec
(
'from
T
kinter import *'
,
dir
)
exec
(
'from
t
kinter import *'
,
dir
)
if
os
.
path
.
isfile
(
class_tcl
):
if
os
.
path
.
isfile
(
class_tcl
):
self
.
tk
.
call
(
'source'
,
class_tcl
)
self
.
tk
.
call
(
'source'
,
class_tcl
)
if
os
.
path
.
isfile
(
class_py
):
if
os
.
path
.
isfile
(
class_py
):
...
...
Lib/tkinter/colorchooser.py
View file @
14fc4270
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
# - title: dialog title
# - title: dialog title
#
#
from
tk
CommonD
ialog
import
Dialog
from
tk
inter.commond
ialog
import
Dialog
#
#
...
...
Lib/tkinter/commondialog.py
View file @
14fc4270
# base class for tk common dialogues
# base class for tk common dialogues
#
#
# this module provides a base class for accessing the common
# this module provides a base class for accessing the common
# dialogues available in Tk 4.2 and newer. use
tkFileD
ialog,
# dialogues available in Tk 4.2 and newer. use
filed
ialog,
#
tkColorChooser, and tkMessageB
ox to access the individual
#
colorchooser, and messageb
ox to access the individual
# dialogs.
# dialogs.
#
#
# written by Fredrik Lundh, May 1997
# written by Fredrik Lundh, May 1997
#
#
from
T
kinter
import
*
from
t
kinter
import
*
class
Dialog
:
class
Dialog
:
...
...
Lib/tkinter/dialog.py
View file @
14fc4270
#
D
ialog.py -- Tkinter interface to the tk_dialog script.
#
d
ialog.py -- Tkinter interface to the tk_dialog script.
from
T
kinter
import
*
from
t
kinter
import
*
from
T
kinter
import
_cnfmerge
from
t
kinter
import
_cnfmerge
if
TkVersion
<=
3.6
:
if
TkVersion
<=
3.6
:
DIALOG_ICON
=
'warning'
DIALOG_ICON
=
'warning'
...
...
Lib/tkinter/dnd.py
View file @
14fc4270
...
@@ -100,7 +100,7 @@ active; it will never call dnd_commit().
...
@@ -100,7 +100,7 @@ active; it will never call dnd_commit().
"""
"""
import
T
kinter
import
t
kinter
# The factory function
# The factory function
...
@@ -219,7 +219,7 @@ class Icon:
...
@@ -219,7 +219,7 @@ class Icon:
self
.
detach
()
self
.
detach
()
if
not
canvas
:
if
not
canvas
:
return
return
label
=
T
kinter
.
Label
(
canvas
,
text
=
self
.
name
,
label
=
t
kinter
.
Label
(
canvas
,
text
=
self
.
name
,
borderwidth
=
2
,
relief
=
"raised"
)
borderwidth
=
2
,
relief
=
"raised"
)
id
=
canvas
.
create_window
(
x
,
y
,
window
=
label
,
anchor
=
"nw"
)
id
=
canvas
.
create_window
(
x
,
y
,
window
=
label
,
anchor
=
"nw"
)
self
.
canvas
=
canvas
self
.
canvas
=
canvas
...
@@ -268,8 +268,8 @@ class Icon:
...
@@ -268,8 +268,8 @@ class Icon:
class
Tester
:
class
Tester
:
def
__init__
(
self
,
root
):
def
__init__
(
self
,
root
):
self
.
top
=
T
kinter
.
Toplevel
(
root
)
self
.
top
=
t
kinter
.
Toplevel
(
root
)
self
.
canvas
=
T
kinter
.
Canvas
(
self
.
top
,
width
=
100
,
height
=
100
)
self
.
canvas
=
t
kinter
.
Canvas
(
self
.
top
,
width
=
100
,
height
=
100
)
self
.
canvas
.
pack
(
fill
=
"both"
,
expand
=
1
)
self
.
canvas
.
pack
(
fill
=
"both"
,
expand
=
1
)
self
.
canvas
.
dnd_accept
=
self
.
dnd_accept
self
.
canvas
.
dnd_accept
=
self
.
dnd_accept
...
@@ -300,9 +300,9 @@ class Tester:
...
@@ -300,9 +300,9 @@ class Tester:
source
.
attach
(
self
.
canvas
,
x
,
y
)
source
.
attach
(
self
.
canvas
,
x
,
y
)
def
test
():
def
test
():
root
=
T
kinter
.
Tk
()
root
=
t
kinter
.
Tk
()
root
.
geometry
(
"+1+1"
)
root
.
geometry
(
"+1+1"
)
T
kinter
.
Button
(
command
=
root
.
quit
,
text
=
"Quit"
).
pack
()
t
kinter
.
Button
(
command
=
root
.
quit
,
text
=
"Quit"
).
pack
()
t1
=
Tester
(
root
)
t1
=
Tester
(
root
)
t1
.
top
.
geometry
(
"+1+60"
)
t1
.
top
.
geometry
(
"+1+60"
)
t2
=
Tester
(
root
)
t2
=
Tester
(
root
)
...
...
Lib/tkinter/filedialog.py
View file @
14fc4270
...
@@ -8,8 +8,8 @@ Classes:
...
@@ -8,8 +8,8 @@ Classes:
"""
"""
from
T
kinter
import
*
from
t
kinter
import
*
from
D
ialog
import
Dialog
from
tkinter.d
ialog
import
Dialog
import
os
import
os
import
fnmatch
import
fnmatch
...
...
Lib/tkinter/font.py
View file @
14fc4270
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
__version__
=
"0.9"
__version__
=
"0.9"
import
T
kinter
import
t
kinter
# weight/slant
# weight/slant
NORMAL
=
"normal"
NORMAL
=
"normal"
...
@@ -65,7 +65,7 @@ class Font:
...
@@ -65,7 +65,7 @@ class Font:
def
__init__
(
self
,
root
=
None
,
font
=
None
,
name
=
None
,
exists
=
False
,
**
options
):
def
__init__
(
self
,
root
=
None
,
font
=
None
,
name
=
None
,
exists
=
False
,
**
options
):
if
not
root
:
if
not
root
:
root
=
T
kinter
.
_default_root
root
=
t
kinter
.
_default_root
if
font
:
if
font
:
# get actual settings corresponding to the given font
# get actual settings corresponding to the given font
font
=
root
.
tk
.
splitlist
(
root
.
tk
.
call
(
"font"
,
"actual"
,
font
))
font
=
root
.
tk
.
splitlist
(
root
.
tk
.
call
(
"font"
,
"actual"
,
font
))
...
@@ -79,7 +79,8 @@ class Font:
...
@@ -79,7 +79,8 @@ class Font:
self
.
delete_font
=
False
self
.
delete_font
=
False
# confirm font exists
# confirm font exists
if
self
.
name
not
in
root
.
tk
.
call
(
"font"
,
"names"
):
if
self
.
name
not
in
root
.
tk
.
call
(
"font"
,
"names"
):
raise
Tkinter
.
_tkinter
.
TclError
(
"named font %s does not already exist"
%
(
self
.
name
,))
raise
tkinter
.
_tkinter
.
TclError
(
"named font %s does not already exist"
%
(
self
.
name
,))
# if font config info supplied, apply it
# if font config info supplied, apply it
if
font
:
if
font
:
root
.
tk
.
call
(
"font"
,
"configure"
,
self
.
name
,
*
font
)
root
.
tk
.
call
(
"font"
,
"configure"
,
self
.
name
,
*
font
)
...
@@ -166,13 +167,13 @@ class Font:
...
@@ -166,13 +167,13 @@ class Font:
def
families
(
root
=
None
):
def
families
(
root
=
None
):
"Get font families (as a tuple)"
"Get font families (as a tuple)"
if
not
root
:
if
not
root
:
root
=
T
kinter
.
_default_root
root
=
t
kinter
.
_default_root
return
root
.
tk
.
splitlist
(
root
.
tk
.
call
(
"font"
,
"families"
))
return
root
.
tk
.
splitlist
(
root
.
tk
.
call
(
"font"
,
"families"
))
def
names
(
root
=
None
):
def
names
(
root
=
None
):
"Get names of defined fonts (as a tuple)"
"Get names of defined fonts (as a tuple)"
if
not
root
:
if
not
root
:
root
=
T
kinter
.
_default_root
root
=
t
kinter
.
_default_root
return
root
.
tk
.
splitlist
(
root
.
tk
.
call
(
"font"
,
"names"
))
return
root
.
tk
.
splitlist
(
root
.
tk
.
call
(
"font"
,
"names"
))
# --------------------------------------------------------------------
# --------------------------------------------------------------------
...
@@ -180,7 +181,7 @@ def names(root=None):
...
@@ -180,7 +181,7 @@ def names(root=None):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
root
=
T
kinter
.
Tk
()
root
=
t
kinter
.
Tk
()
# create a font
# create a font
f
=
Font
(
family
=
"times"
,
size
=
30
,
weight
=
NORMAL
)
f
=
Font
(
family
=
"times"
,
size
=
30
,
weight
=
NORMAL
)
...
@@ -202,10 +203,10 @@ if __name__ == "__main__":
...
@@ -202,10 +203,10 @@ if __name__ == "__main__":
f
=
Font
(
font
=
(
"Courier"
,
20
,
"bold"
))
f
=
Font
(
font
=
(
"Courier"
,
20
,
"bold"
))
print
(
f
.
measure
(
"hello"
),
f
.
metrics
(
"linespace"
))
print
(
f
.
measure
(
"hello"
),
f
.
metrics
(
"linespace"
))
w
=
T
kinter
.
Label
(
root
,
text
=
"Hello, world"
,
font
=
f
)
w
=
t
kinter
.
Label
(
root
,
text
=
"Hello, world"
,
font
=
f
)
w
.
pack
()
w
.
pack
()
w
=
T
kinter
.
Button
(
root
,
text
=
"Quit!"
,
command
=
root
.
destroy
)
w
=
t
kinter
.
Button
(
root
,
text
=
"Quit!"
,
command
=
root
.
destroy
)
w
.
pack
()
w
.
pack
()
fb
=
Font
(
font
=
w
[
"font"
]).
copy
()
fb
=
Font
(
font
=
w
[
"font"
]).
copy
()
...
@@ -213,4 +214,4 @@ if __name__ == "__main__":
...
@@ -213,4 +214,4 @@ if __name__ == "__main__":
w
.
config
(
font
=
fb
)
w
.
config
(
font
=
fb
)
T
kinter
.
mainloop
()
t
kinter
.
mainloop
()
Lib/tkinter/messagebox.py
View file @
14fc4270
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
# - type: dialog type; that is, which buttons to display (see below)
# - type: dialog type; that is, which buttons to display (see below)
#
#
from
tk
CommonD
ialog
import
Dialog
from
tk
inter.commond
ialog
import
Dialog
#
#
# constants
# constants
...
...
Lib/tkinter/scrolledtext.py
View file @
14fc4270
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
# Most methods calls are inherited from the Text widget; Pack methods
# Most methods calls are inherited from the Text widget; Pack methods
# are redirected to the Frame widget however.
# are redirected to the Frame widget however.
from
T
kinter
import
*
from
t
kinter
import
*
from
T
kinter
import
_cnfmerge
from
t
kinter
import
_cnfmerge
class
ScrolledText
(
Text
):
class
ScrolledText
(
Text
):
def
__init__
(
self
,
master
=
None
,
cnf
=
None
,
**
kw
):
def
__init__
(
self
,
master
=
None
,
cnf
=
None
,
**
kw
):
...
...
Lib/tkinter/simpledialog.py
View file @
14fc4270
"""A simple but flexible modal dialog box."""
"""A simple but flexible modal dialog box."""
from
T
kinter
import
*
from
t
kinter
import
*
class
SimpleDialog
:
class
SimpleDialog
:
...
...
Lib/tkinter/tix.py
View file @
14fc4270
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
# appreciate the advantages.
# appreciate the advantages.
#
#
from
T
kinter
import
*
from
t
kinter
import
*
from
T
kinter
import
_flatten
,
_cnfmerge
,
_default_root
from
t
kinter
import
_flatten
,
_cnfmerge
,
_default_root
# WARNING - TkVersion is a limited precision floating point number
# WARNING - TkVersion is a limited precision floating point number
if
TkVersion
<
3.999
:
if
TkVersion
<
3.999
:
...
@@ -57,7 +57,7 @@ TCL_ALL_EVENTS = 0
...
@@ -57,7 +57,7 @@ TCL_ALL_EVENTS = 0
# BEWARE - this is implemented by copying some code from the Widget class
# BEWARE - this is implemented by copying some code from the Widget class
# in Tkinter (to override Widget initialization) and is therefore
# in Tkinter (to override Widget initialization) and is therefore
# liable to break.
# liable to break.
import
T
kinter
,
os
import
t
kinter
,
os
# Could probably add this to Tkinter.Misc
# Could probably add this to Tkinter.Misc
class
tixCommand
:
class
tixCommand
:
...
@@ -192,11 +192,11 @@ class tixCommand:
...
@@ -192,11 +192,11 @@ class tixCommand:
else
:
else
:
return
self
.
tk
.
call
(
'tix'
,
'resetoptions'
,
newScheme
,
newFontSet
)
return
self
.
tk
.
call
(
'tix'
,
'resetoptions'
,
newScheme
,
newFontSet
)
class
Tk
(
T
kinter
.
Tk
,
tixCommand
):
class
Tk
(
t
kinter
.
Tk
,
tixCommand
):
"""Toplevel widget of Tix which represents mostly the main window
"""Toplevel widget of Tix which represents mostly the main window
of an application. It has an associated Tcl interpreter."""
of an application. It has an associated Tcl interpreter."""
def
__init__
(
self
,
screenName
=
None
,
baseName
=
None
,
className
=
'Tix'
):
def
__init__
(
self
,
screenName
=
None
,
baseName
=
None
,
className
=
'Tix'
):
T
kinter
.
Tk
.
__init__
(
self
,
screenName
,
baseName
,
className
)
t
kinter
.
Tk
.
__init__
(
self
,
screenName
,
baseName
,
className
)
tixlib
=
os
.
environ
.
get
(
'TIX_LIBRARY'
)
tixlib
=
os
.
environ
.
get
(
'TIX_LIBRARY'
)
self
.
tk
.
eval
(
'global auto_path; lappend auto_path [file dir [info nameof]]'
)
self
.
tk
.
eval
(
'global auto_path; lappend auto_path [file dir [info nameof]]'
)
if
tixlib
is
not
None
:
if
tixlib
is
not
None
:
...
@@ -212,7 +212,7 @@ class Tk(Tkinter.Tk, tixCommand):
...
@@ -212,7 +212,7 @@ class Tk(Tkinter.Tk, tixCommand):
def
destroy
(
self
):
def
destroy
(
self
):
# For safety, remove an delete_window binding before destroy
# For safety, remove an delete_window binding before destroy
self
.
protocol
(
"WM_DELETE_WINDOW"
,
""
)
self
.
protocol
(
"WM_DELETE_WINDOW"
,
""
)
T
kinter
.
Tk
.
destroy
(
self
)
t
kinter
.
Tk
.
destroy
(
self
)
# The Tix 'tixForm' geometry manager
# The Tix 'tixForm' geometry manager
class
Form
:
class
Form
:
...
@@ -260,9 +260,9 @@ class Form:
...
@@ -260,9 +260,9 @@ class Form:
Tkinter
.
Widget
.
__bases__
=
T
kinter
.
Widget
.
__bases__
+
(
Form
,)
tkinter
.
Widget
.
__bases__
=
t
kinter
.
Widget
.
__bases__
+
(
Form
,)
class
TixWidget
(
T
kinter
.
Widget
):
class
TixWidget
(
t
kinter
.
Widget
):
"""A TixWidget class is used to package all (or most) Tix widgets.
"""A TixWidget class is used to package all (or most) Tix widgets.
Widget initialization is extended in two ways:
Widget initialization is extended in two ways:
...
@@ -383,7 +383,7 @@ class TixWidget(Tkinter.Widget):
...
@@ -383,7 +383,7 @@ class TixWidget(Tkinter.Widget):
# These are missing from Tkinter
# These are missing from Tkinter
def
image_create
(
self
,
imgtype
,
cnf
=
{},
master
=
None
,
**
kw
):
def
image_create
(
self
,
imgtype
,
cnf
=
{},
master
=
None
,
**
kw
):
if
not
master
:
if
not
master
:
master
=
T
kinter
.
_default_root
master
=
t
kinter
.
_default_root
if
not
master
:
if
not
master
:
raise
RuntimeError
(
'Too early to create image'
)
raise
RuntimeError
(
'Too early to create image'
)
if
kw
and
cnf
:
cnf
=
_cnfmerge
((
cnf
,
kw
))
if
kw
and
cnf
:
cnf
=
_cnfmerge
((
cnf
,
kw
))
...
...
Lib/tkinter/turtle.py
View file @
14fc4270
...
@@ -16,7 +16,7 @@ pictures can easily be drawn.
...
@@ -16,7 +16,7 @@ pictures can easily be drawn.
from
math
import
*
# Also for export
from
math
import
*
# Also for export
from
time
import
sleep
from
time
import
sleep
import
T
kinter
import
t
kinter
speeds
=
[
'fastest'
,
'fast'
,
'normal'
,
'slow'
,
'slowest'
]
speeds
=
[
'fastest'
,
'fast'
,
'normal'
,
'slow'
,
'slowest'
]
...
@@ -238,7 +238,7 @@ class RawPen:
...
@@ -238,7 +238,7 @@ class RawPen:
# Test the color first
# Test the color first
try
:
try
:
id
=
self
.
_canvas
.
create_line
(
0
,
0
,
0
,
0
,
fill
=
color
)
id
=
self
.
_canvas
.
create_line
(
0
,
0
,
0
,
0
,
fill
=
color
)
except
T
kinter
.
TclError
:
except
t
kinter
.
TclError
:
raise
Error
(
"bad color string: %r"
%
(
color
,))
raise
Error
(
"bad color string: %r"
%
(
color
,))
self
.
_set_color
(
color
)
self
.
_set_color
(
color
)
return
return
...
@@ -554,7 +554,7 @@ class RawPen:
...
@@ -554,7 +554,7 @@ class RawPen:
# in case nhops==0
# in case nhops==0
self
.
_canvas
.
coords
(
item
,
x0
,
y0
,
x1
,
y1
)
self
.
_canvas
.
coords
(
item
,
x0
,
y0
,
x1
,
y1
)
self
.
_canvas
.
itemconfigure
(
item
,
arrow
=
"none"
)
self
.
_canvas
.
itemconfigure
(
item
,
arrow
=
"none"
)
except
T
kinter
.
TclError
:
except
t
kinter
.
TclError
:
# Probably the window was closed!
# Probably the window was closed!
return
return
else
:
else
:
...
@@ -638,13 +638,13 @@ class Pen(RawPen):
...
@@ -638,13 +638,13 @@ class Pen(RawPen):
def
__init__
(
self
):
def
__init__
(
self
):
global
_root
,
_canvas
global
_root
,
_canvas
if
_root
is
None
:
if
_root
is
None
:
_root
=
T
kinter
.
Tk
()
_root
=
t
kinter
.
Tk
()
_root
.
wm_protocol
(
"WM_DELETE_WINDOW"
,
self
.
_destroy
)
_root
.
wm_protocol
(
"WM_DELETE_WINDOW"
,
self
.
_destroy
)
_root
.
title
(
_title
)
_root
.
title
(
_title
)
if
_canvas
is
None
:
if
_canvas
is
None
:
# XXX Should have scroll bars
# XXX Should have scroll bars
_canvas
=
T
kinter
.
Canvas
(
_root
,
background
=
"white"
)
_canvas
=
t
kinter
.
Canvas
(
_root
,
background
=
"white"
)
_canvas
.
pack
(
expand
=
1
,
fill
=
"both"
)
_canvas
.
pack
(
expand
=
1
,
fill
=
"both"
)
setup
(
width
=
_width
,
height
=
_height
,
startx
=
_startx
,
starty
=
_starty
)
setup
(
width
=
_width
,
height
=
_height
,
startx
=
_startx
,
starty
=
_starty
)
...
...
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