]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Renamed module tkinter to _tkinter
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 23 Oct 1995 14:36:05 +0000 (14:36 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 23 Oct 1995 14:36:05 +0000 (14:36 +0000)
Demo/tkinter/README
Demo/tkinter/guido/ManPage.py
Demo/tkinter/guido/wish.py
Lib/lib-tk/Tkinter.py
Lib/tkinter/Tkinter.py
Misc/FAQ
README

index 257c95af42ab5c7afd504ded0ccad74d38f969e0..9fa7cb4e24c6b4ee3b62915bdca8726465493ec2 100644 (file)
@@ -1,7 +1,7 @@
 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:
index b8b6682e8108a551449a47888803124a69db4105..4f0af8c42ad785bdacc9920820f2bd199b518bbf 100755 (executable)
@@ -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
index eec4b695307686e11ab960615fb218efcd37c154..4f6fdee9038f4fe2e5b5c755edc7de397e26bc31 100755 (executable)
@@ -1,9 +1,9 @@
 # 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
index aace39a0636ad233d3de6a0a8c0f03b08247e452..3c2b0abf02c57ce7ce10f8fc1aee06c84880c395 100644 (file)
@@ -1,15 +1,15 @@
 # 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" \
index aace39a0636ad233d3de6a0a8c0f03b08247e452..3c2b0abf02c57ce7ce10f8fc1aee06c84880c395 100755 (executable)
@@ -1,15 +1,15 @@
 # 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" \
index 44a0d29503411f2f195f3e4e988d1922a8dd9678..72a85c4edd0ca4006447e37966354d26d85abc1b 100644 (file)
--- a/Misc/FAQ
+++ b/Misc/FAQ
@@ -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
diff --git a/README b/README
index dc3c4dd1fa7b6d9ced8565b57d317d87863427cd..9ca0c952720d4440b196179f43b78a852e089245 100644 (file)
--- a/README
+++ b/README
@@ -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.)