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
10d0f8fc
Commit
10d0f8fc
authored
Oct 23, 1995
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed module tkinter to _tkinter
parent
f39ca24e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
36 deletions
+37
-36
Demo/tkinter/README
Demo/tkinter/README
+1
-1
Demo/tkinter/guido/ManPage.py
Demo/tkinter/guido/ManPage.py
+2
-1
Demo/tkinter/guido/wish.py
Demo/tkinter/guido/wish.py
+3
-3
Lib/lib-tk/Tkinter.py
Lib/lib-tk/Tkinter.py
+9
-9
Lib/tkinter/Tkinter.py
Lib/tkinter/Tkinter.py
+9
-9
Misc/FAQ
Misc/FAQ
+6
-6
README
README
+7
-7
No files found.
Demo/tkinter/README
View file @
10d0f8fc
Several collections of example code for Tkinter.
See the toplevel README for an explanation of the difference between
Tkinter and tkinter, how to enable the Python Tk interface, and where
Tkinter and
_
tkinter, how to enable the Python Tk interface, and where
to get Matt Conway's lifesaver document.
Subdirectories:
...
...
Demo/tkinter/guido/ManPage.py
View file @
10d0f8fc
...
...
@@ -2,6 +2,7 @@
import
regex
from
Tkinter
import
*
from
Tkinter
import
_tkinter
from
ScrolledText
import
ScrolledText
# XXX These fonts may have to be changed to match your system
...
...
@@ -44,7 +45,7 @@ class EditableManPage(ScrolledText):
# Parse a file, in the background
def
asyncparsefile
(
self
,
fp
):
self
.
_startparser
(
fp
)
self
.
tk
.
createfilehandler
(
fp
,
tkinter
.
READABLE
,
self
.
tk
.
createfilehandler
(
fp
,
_
tkinter
.
READABLE
,
self
.
_filehandler
)
parsefile
=
asyncparsefile
# Alias
...
...
Demo/tkinter/guido/wish.py
View file @
10d0f8fc
# This is about all it requires to write a wish shell in Python!
import
tkinter
import
_
tkinter
import
os
tk
=
tkinter
.
create
(
os
.
environ
[
'DISPLAY'
],
'wish'
,
'Tk'
,
1
)
tk
=
_
tkinter
.
create
(
os
.
environ
[
'DISPLAY'
],
'wish'
,
'Tk'
,
1
)
tk
.
call
(
'update'
)
cmd
=
''
...
...
@@ -20,7 +20,7 @@ while 1:
tk
.
record
(
line
)
try
:
result
=
tk
.
call
(
'eval'
,
cmd
)
except
tkinter
.
TclError
,
msg
:
except
_
tkinter
.
TclError
,
msg
:
print
'TclError:'
,
msg
else
:
if
result
:
print
result
...
...
Lib/lib-tk/Tkinter.py
View file @
10d0f8fc
# Tkinter.py -- Tk/Tcl widget wrappers
import
tkinter
from
tkinter
import
TclError
import
_
tkinter
from
_
tkinter
import
TclError
from
types
import
*
from
Tkconstants
import
*
CallableTypes
=
(
FunctionType
,
MethodType
,
BuiltinFunctionType
,
BuiltinMethodType
)
TkVersion
=
eval
(
tkinter
.
TK_VERSION
)
TclVersion
=
eval
(
tkinter
.
TCL_VERSION
)
TkVersion
=
eval
(
_
tkinter
.
TK_VERSION
)
TclVersion
=
eval
(
_
tkinter
.
TCL_VERSION
)
def
_flatten
(
tuple
):
...
...
@@ -575,18 +575,18 @@ class Tk(Misc, Wm):
import
sys
,
os
baseName
=
os
.
path
.
basename
(
sys
.
argv
[
0
])
if
baseName
[
-
3
:]
==
'.py'
:
baseName
=
baseName
[:
-
3
]
self
.
tk
=
tkinter
.
create
(
screenName
,
baseName
,
className
)
self
.
tk
=
_
tkinter
.
create
(
screenName
,
baseName
,
className
)
# Version sanity checks
tk_version
=
self
.
tk
.
getvar
(
'tk_version'
)
if
tk_version
!=
tkinter
.
TK_VERSION
:
if
tk_version
!=
_
tkinter
.
TK_VERSION
:
raise
RuntimeError
,
\
"tk.h version (%s) doesn't match libtk.a version (%s)"
\
%
(
tkinter
.
TK_VERSION
,
tk_version
)
%
(
_
tkinter
.
TK_VERSION
,
tk_version
)
tcl_version
=
self
.
tk
.
getvar
(
'tcl_version'
)
if
tcl_version
!=
tkinter
.
TCL_VERSION
:
if
tcl_version
!=
_
tkinter
.
TCL_VERSION
:
raise
RuntimeError
,
\
"tcl.h version (%s) doesn't match libtcl.a version (%s)"
\
%
(
tkinter
.
TCL_VERSION
,
tcl_version
)
%
(
_
tkinter
.
TCL_VERSION
,
tcl_version
)
if
TkVersion
<
4.0
:
raise
RuntimeError
,
\
"Tk 4.0 or higher is required; found Tk %s"
\
...
...
Lib/tkinter/Tkinter.py
View file @
10d0f8fc
# Tkinter.py -- Tk/Tcl widget wrappers
import
tkinter
from
tkinter
import
TclError
import
_
tkinter
from
_
tkinter
import
TclError
from
types
import
*
from
Tkconstants
import
*
CallableTypes
=
(
FunctionType
,
MethodType
,
BuiltinFunctionType
,
BuiltinMethodType
)
TkVersion
=
eval
(
tkinter
.
TK_VERSION
)
TclVersion
=
eval
(
tkinter
.
TCL_VERSION
)
TkVersion
=
eval
(
_
tkinter
.
TK_VERSION
)
TclVersion
=
eval
(
_
tkinter
.
TCL_VERSION
)
def
_flatten
(
tuple
):
...
...
@@ -575,18 +575,18 @@ class Tk(Misc, Wm):
import
sys
,
os
baseName
=
os
.
path
.
basename
(
sys
.
argv
[
0
])
if
baseName
[
-
3
:]
==
'.py'
:
baseName
=
baseName
[:
-
3
]
self
.
tk
=
tkinter
.
create
(
screenName
,
baseName
,
className
)
self
.
tk
=
_
tkinter
.
create
(
screenName
,
baseName
,
className
)
# Version sanity checks
tk_version
=
self
.
tk
.
getvar
(
'tk_version'
)
if
tk_version
!=
tkinter
.
TK_VERSION
:
if
tk_version
!=
_
tkinter
.
TK_VERSION
:
raise
RuntimeError
,
\
"tk.h version (%s) doesn't match libtk.a version (%s)"
\
%
(
tkinter
.
TK_VERSION
,
tk_version
)
%
(
_
tkinter
.
TK_VERSION
,
tk_version
)
tcl_version
=
self
.
tk
.
getvar
(
'tcl_version'
)
if
tcl_version
!=
tkinter
.
TCL_VERSION
:
if
tcl_version
!=
_
tkinter
.
TCL_VERSION
:
raise
RuntimeError
,
\
"tcl.h version (%s) doesn't match libtcl.a version (%s)"
\
%
(
tkinter
.
TCL_VERSION
,
tcl_version
)
%
(
_
tkinter
.
TCL_VERSION
,
tcl_version
)
if
TkVersion
<
4.0
:
raise
RuntimeError
,
\
"Tk 4.0 or higher is required; found Tk %s"
\
...
...
Misc/FAQ
View file @
10d0f8fc
...
...
@@ -113,7 +113,7 @@ Here's an overview of the questions per chapter:
3.14. Q. Under Solaris 2.x, using GCC, how do I use shared libraries?
3.15. Q. Errors when linking with a shared library containing C++ code.
3.16. Q. Tk menus or radiobuttons don't work properly in Python 1.2.
3.17. Q. I built with tkintermodule.c enabled but get "Tkinter not found".
3.17. Q. I built with
_
tkintermodule.c enabled but get "Tkinter not found".
3.18. Q. I built with Tk 4.0 but Tkinter complains about the Tk version.
3.19. Q. Tk doesn't work right on DEC Alpha.
...
...
@@ -876,7 +876,7 @@ edit config.c slightly to make it compilable with C++.
A. There's a bug in Tkinter.py; remove ClassType and InstanceType from
the definition of CallableTypes near the top of Lib/tkinter/Tkinter.py.
3.17. Q. I built with tkintermodule.c enabled but get "Tkinter not found".
3.17. Q. I built with
_
tkintermodule.c enabled but get "Tkinter not found".
A. Tkinter.py (note: upper case T) lives in a subdirectory of Lib,
Lib/tkinter. If you are using the default module search path, you
...
...
@@ -1111,10 +1111,10 @@ the module only works on specific platforms (e.g. gl only works on SGI
machines).
NOTE: if the complaint is about "Tkinter" (upper case T) and you have
already configured module "
tkinter" (lower case t), the solution is
*not* to rename tkinter to Tkinter or vice versa. There is probably
something wrong with your module search path. Check out the value of
sys.path.
already configured module "
_tkinter" (lower case t and underscore),
the solution is *not* to rename tkinter to Tkinter or vice versa.
There is probably something wrong with your module search path. Check
out the value of
sys.path.
For X-related modules (Xt and Xm) you will have to do more work: they
are currently not part of the standard Python distribution. You will
...
...
README
View file @
10d0f8fc
...
...
@@ -450,8 +450,8 @@ found in Lib/tk3inter/.)
To enable the Python/Tk interface, once you've built and installed
Tcl/Tk, all you need to do is edit two lines in Modules/Setup; search
for the string "tkinter". Un-comment one (normally the first) of the
lines beginning with "#tkinter" and un-comment the line beginning with
for the string "
_
tkinter". Un-comment one (normally the first) of the
lines beginning with "#
_
tkinter" and un-comment the line beginning with
"#TKPATH". (If you have installed Tcl/Tk in unusual places you will
have to edit the first line as well to fix the -I and -L options.)
See the Build Instructions above for more details.
...
...
@@ -463,15 +463,15 @@ the Demo/tkinter directory, in the subdirectories guido, matt and www.
Note that there's a Python module called "Tkinter" (capital T) which
lives in Lib/tkinter/Tkinter.py, and a C module called "tkinter"
(lower case t) which lives in Modules/
tkintermodule
.c. Demos and
(lower case t) which lives in Modules/
_tkinter
.c. Demos and
normal Tk applications only import the Python Tkinter module -- only
the latter uses the C tkinter module directly. In order to find the C
tkinter module, it must be compiled and linked into the Python
interpreter -- the tkinter line in the Setup file does this. In order
the latter uses the C
_
tkinter module directly. In order to find the C
_
tkinter module, it must be compiled and linked into the Python
interpreter -- the
_
tkinter line in the Setup file does this. In order
to find the Python Tkinter module, sys.path must be set correctly --
the TKPATH assignment in the Setup file takes care of this, but only
if you install Python properly ("make install libinstall"). (You can
also use dynamic loading for the C tkinter module, in which case you
also use dynamic loading for the C
_
tkinter module, in which case you
must manually fix up sys.path or set $PYTHONPATH for the Python
Tkinter module.)
...
...
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