diff options
author | Georg Brandl <georg@python.org> | 2008-05-20 07:13:37 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-20 07:13:37 +0000 |
commit | 6634bf2919d855ccd821e878b8cc00c7209f1cbe (patch) | |
tree | 77ef2dfaaf00ec144e75ac19708e4dd457604ebc /Lib/lib-tk/Tkinter.py | |
parent | 33cece05b918dff706a4298e33f84d8e8a0391d2 (diff) | |
download | cpython-git-6634bf2919d855ccd821e878b8cc00c7209f1cbe.tar.gz |
Tkinter rename reversal: remove tkinter package, adapt imports and docs.
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index d83b2baa6b..dccabad2cb 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -18,14 +18,14 @@ Actions are bound to events by resources (e.g. keyword argument command) or with the method bind. Example (Hello, World): -import tkinter -from tkinter.constants import * -tk = tkinter.Tk() -frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2) +import Tkinter +from Tkconstants import * +tk = Tkinter.Tk() +frame = Tkinter.Frame(tk, relief=RIDGE, borderwidth=2) frame.pack(fill=BOTH,expand=1) -label = tkinter.Label(frame, text="Hello, World") +label = Tkinter.Label(frame, text="Hello, World") label.pack(fill=X, expand=1) -button = tkinter.Button(frame,text="Exit",command=tk.destroy) +button = Tkinter.Button(frame,text="Exit",command=tk.destroy) button.pack(side=BOTTOM) tk.mainloop() """ @@ -35,11 +35,12 @@ __version__ = "$Revision$" import sys if sys.platform == "win32": # Attempt to configure Tcl/Tk without requiring PATH - from tkinter import _fix + import FixTk import _tkinter # If this fails your Python may not be configured for Tk +tkinter = _tkinter # b/w compat for export TclError = _tkinter.TclError from types import * -from tkinter.constants import * +from Tkconstants import * try: import MacOS; _MacOS = MacOS; del MacOS except ImportError: @@ -1697,7 +1698,7 @@ class Tk(Misc, Wm): base_tcl = os.path.join(home, '.%s.tcl' % baseName) base_py = os.path.join(home, '.%s.py' % baseName) dir = {'self': self} - exec 'from tkinter import *' in dir + exec 'from Tkinter import *' in dir if os.path.isfile(class_tcl): self.tk.call('source', class_tcl) if os.path.isfile(class_py): |