Skip to content

Commit 1a263ad

Browse files
committed
python#7057: fix several errors.
1 parent 580d60c commit 1a263ad

File tree

6 files changed

+68
-55
lines changed

6 files changed

+68
-55
lines changed

Doc/library/pydoc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ that will serve documentation to visiting Web browsers. :program:`pydoc`
5454
:option:`-p 1234` will start a HTTP server on port 1234, allowing you to browse
5555
the documentation at ``http://localhost:1234/`` in your preferred Web browser.
5656
:program:`pydoc` :option:`-g` will start the server and additionally bring up a
57-
small :mod:`Tkinter`\ -based graphical interface to help you search for
57+
small :mod:`tkinter`\ -based graphical interface to help you search for
5858
documentation pages.
5959

6060
When :program:`pydoc` generates documentation, it uses the current environment

Doc/library/tkinter.rst

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ is maintained at ActiveState.)
3030
Tkinter Modules
3131
---------------
3232

33-
Most of the time, the :mod:`tkinter` is all you really need, but a number
34-
of additional modules are available as well. The Tk interface is located in a
33+
Most of the time, :mod:`tkinter` is all you really need, but a number of
34+
additional modules are available as well. The Tk interface is located in a
3535
binary module named :mod:`_tkinter`. This module contains the low-level
3636
interface to Tk, and should never be used directly by application programmers.
3737
It is usually a shared library (or DLL), but might in some cases be statically
@@ -112,13 +112,13 @@ orientation on the system.
112112

113113
Credits:
114114

115-
* Tkinter was written by Steen Lumholt and Guido van Rossum.
116-
117115
* Tk was written by John Ousterhout while at Berkeley.
118116

117+
* Tkinter was written by Steen Lumholt and Guido van Rossum.
118+
119119
* This Life Preserver was written by Matt Conway at the University of Virginia.
120120

121-
* The html rendering, and some liberal editing, was produced from a FrameMaker
121+
* The HTML rendering, and some liberal editing, was produced from a FrameMaker
122122
version by Ken Manheimer.
123123

124124
* Fredrik Lundh elaborated and revised the class interface descriptions, to get
@@ -143,10 +143,10 @@ order to use Tkinter, you will have to know a little bit about Tk. This document
143143
can't fulfill that role, so the best we can do is point you to the best
144144
documentation that exists. Here are some hints:
145145

146-
* The authors strongly suggest getting a copy of the Tk man pages. Specifically,
147-
the man pages in the ``mann`` directory are most useful. The ``man3`` man pages
148-
describe the C interface to the Tk library and thus are not especially helpful
149-
for script writers.
146+
* The authors strongly suggest getting a copy of the Tk man pages.
147+
Specifically, the man pages in the ``manN`` directory are most useful.
148+
The ``man3`` man pages describe the C interface to the Tk library and thus
149+
are not especially helpful for script writers.
150150

151151
* Addison-Wesley publishes a book called Tcl and the Tk Toolkit by John
152152
Ousterhout (ISBN 0-201-63337-X) which is a good introduction to Tcl and Tk for
@@ -159,6 +159,9 @@ documentation that exists. Here are some hints:
159159

160160
.. seealso::
161161

162+
`Tcl/Tk 8.6 man pages <http://www.tcl.tk/man/tcl8.6/>`_
163+
The Tcl/Tk manual on www.tcl.tk.
164+
162165
`ActiveState Tcl Home Page <http://tcl.activestate.com/>`_
163166
The Tk/Tcl development is largely taking place at ActiveState.
164167

@@ -183,8 +186,8 @@ A Simple Hello World Program
183186
def createWidgets(self):
184187
self.QUIT = Button(self)
185188
self.QUIT["text"] = "QUIT"
186-
self.QUIT["fg"] = "red"
187-
self.QUIT["command"] = self.quit
189+
self.QUIT["fg"] = "red"
190+
self.QUIT["command"] = self.quit
188191

189192
self.QUIT.pack({"side": "left"})
190193

@@ -257,7 +260,7 @@ To make a widget in Tk, the command is always of the form::
257260
For example::
258261

259262
button .fred -fg red -text "hi there"
260-
^ ^ \_____________________/
263+
^ ^ \______________________/
261264
| | |
262265
class new options
263266
command widget (-opt val -opt val ...)
@@ -301,15 +304,15 @@ constructor, and keyword-args for configure calls or as instance indices, in
301304
dictionary style, for established instances. See section
302305
:ref:`tkinter-setting-options` on setting options. ::
303306

304-
button .fred -fg red =====> fred = Button(panel, fg = "red")
307+
button .fred -fg red =====> fred = Button(panel, fg="red")
305308
.fred configure -fg red =====> fred["fg"] = red
306-
OR ==> fred.config(fg = "red")
309+
OR ==> fred.config(fg="red")
307310

308311
In Tk, to perform an action on a widget, use the widget name as a command, and
309312
follow it with an action name, possibly with arguments (options). In Tkinter,
310313
you call methods on the class instance to invoke actions on the widget. The
311-
actions (methods) that a given widget can perform are listed in the Tkinter.py
312-
module. ::
314+
actions (methods) that a given widget can perform are listed in
315+
:file:`tkinter/__init__.py`. ::
313316

314317
.fred invoke =====> fred.invoke()
315318

@@ -320,7 +323,7 @@ various forms of the pack command are implemented as methods. All widgets in
320323
methods. See the :mod:`tkinter.tix` module documentation for additional
321324
information on the Form geometry manager. ::
322325

323-
pack .fred -side left =====> fred.pack(side = "left")
326+
pack .fred -side left =====> fred.pack(side="left")
324327

325328

326329
How Tk and Tkinter are Related
@@ -332,14 +335,15 @@ Your App Here (Python)
332335
A Python application makes a :mod:`tkinter` call.
333336

334337
tkinter (Python Package)
335-
This call (say, for example, creating a button widget), is implemented in the
336-
*tkinter* package, which is written in Python. This Python function will parse
337-
the commands and the arguments and convert them into a form that makes them look
338-
as if they had come from a Tk script instead of a Python script.
338+
This call (say, for example, creating a button widget), is implemented in
339+
the :mod:`tkinter` package, which is written in Python. This Python
340+
function will parse the commands and the arguments and convert them into a
341+
form that makes them look as if they had come from a Tk script instead of
342+
a Python script.
339343

340-
tkinter (C)
344+
_tkinter (C)
341345
These commands and their arguments will be passed to a C function in the
342-
*tkinter* - note the lowercase - extension module.
346+
:mod:`_tkinter` - note the underscore - extension module.
343347

344348
Tk Widgets (C and Tcl)
345349
This C function is able to make calls into other C modules, including the C
@@ -370,7 +374,7 @@ be set in three ways:
370374
At object creation time, using keyword arguments
371375
::
372376

373-
fred = Button(self, fg = "red", bg = "blue")
377+
fred = Button(self, fg="red", bg="blue")
374378

375379
After object creation, treating the option name like a dictionary index
376380
::
@@ -381,7 +385,7 @@ After object creation, treating the option name like a dictionary index
381385
Use the config() method to update multiple attrs subsequent to object creation
382386
::
383387

384-
fred.config(fg = "red", bg = "blue")
388+
fred.config(fg="red", bg="blue")
385389

386390
For a complete explanation of a given option and its behavior, see the Tk man
387391
pages for the widget in question.
@@ -464,8 +468,8 @@ where the widget is to appear within its container, and how it is to behave when
464468
the main application window is resized. Here are some examples::
465469

466470
fred.pack() # defaults to side = "top"
467-
fred.pack(side = "left")
468-
fred.pack(expand = 1)
471+
fred.pack(side="left")
472+
fred.pack(expand=1)
469473

470474

471475
Packer Options
@@ -506,7 +510,7 @@ Unfortunately, in the current implementation of :mod:`tkinter` it is not
506510
possible to hand over an arbitrary Python variable to a widget through a
507511
``variable`` or ``textvariable`` option. The only kinds of variables for which
508512
this works are variables that are subclassed from a class called Variable,
509-
defined in the :mod:`tkinter`.
513+
defined in :mod:`tkinter`.
510514

511515
There are many useful subclasses of Variable already defined:
512516
:class:`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and
@@ -606,7 +610,7 @@ callback
606610
This is any Python function that takes no arguments. For example::
607611

608612
def print_it():
609-
print("hi there")
613+
print("hi there")
610614
fred["command"] = print_it
611615

612616
color
@@ -702,24 +706,32 @@ Notice how the widget field of the event is being accessed in the
702706
:meth:`turnRed` callback. This field contains the widget that caught the X
703707
event. The following table lists the other event fields you can access, and how
704708
they are denoted in Tk, which can be useful when referring to the Tk man pages.
705-
::
706709

707-
Tk Tkinter Event Field Tk Tkinter Event Field
708-
-- ------------------- -- -------------------
709-
%f focus %A char
710-
%h height %E send_event
711-
%k keycode %K keysym
712-
%s state %N keysym_num
713-
%t time %T type
714-
%w width %W widget
715-
%x x %X x_root
716-
%y y %Y y_root
710+
+----+---------------------+----+---------------------+
711+
| Tk | Tkinter Event Field | Tk | Tkinter Event Field |
712+
+====+=====================+====+=====================+
713+
| %f | focus | %A | char |
714+
+----+---------------------+----+---------------------+
715+
| %h | height | %E | send_event |
716+
+----+---------------------+----+---------------------+
717+
| %k | keycode | %K | keysym |
718+
+----+---------------------+----+---------------------+
719+
| %s | state | %N | keysym_num |
720+
+----+---------------------+----+---------------------+
721+
| %t | time | %T | type |
722+
+----+---------------------+----+---------------------+
723+
| %w | width | %W | widget |
724+
+----+---------------------+----+---------------------+
725+
| %x | x | %X | x_root |
726+
+----+---------------------+----+---------------------+
727+
| %y | y | %Y | y_root |
728+
+----+---------------------+----+---------------------+
717729

718730

719731
The index Parameter
720732
^^^^^^^^^^^^^^^^^^^
721733

722-
A number of widgets require"index" parameters to be passed. These are used to
734+
A number of widgets require "index" parameters to be passed. These are used to
723735
point at a specific place in a Text widget, or to particular characters in an
724736
Entry widget, or to particular menu items in a Menu widget.
725737

@@ -755,7 +767,7 @@ Menu indexes (menu.invoke(), menu.entryconfig(), etc.)
755767
* an integer which refers to the numeric position of the entry in the widget,
756768
counted from the top, starting with 0;
757769

758-
* the string ``'active'``, which refers to the menu position that is currently
770+
* the string ``"active"``, which refers to the menu position that is currently
759771
under the cursor;
760772

761773
* the string ``"last"`` which refers to the last menu item;

Doc/library/tkinter.tix.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Tix Widgets
8484
-----------
8585

8686
`Tix <http://tix.sourceforge.net/dist/current/man/html/TixCmd/TixIntro.htm>`_
87-
introduces over 40 widget classes to the :mod:`Tkinter` repertoire. There is a
87+
introduces over 40 widget classes to the :mod:`tkinter` repertoire. There is a
8888
demo of all the :mod:`tkinter.tix` widgets in the :file:`Demo/tix` directory of
8989
the standard distribution.
9090

Doc/library/tkinter.ttk.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,13 @@ All the :mod:`ttk` Widgets accepts the following options:
116116
| | for the parent widget. |
117117
+-----------+--------------------------------------------------------------+
118118
| takefocus | Determines whether the window accepts the focus during |
119-
| | keyboard traversal. 0, 1 or an empty is return. If 0 is |
120-
| | returned, it means that the window should be skipped entirely|
121-
| | during keyboard traversal. If 1, it means that the window |
122-
| | should receive the input focus as long as it is viewable. And|
123-
| | an empty string means that the traversal scripts make the |
124-
| | decision about whether or not to focus on the window. |
119+
| | keyboard traversal. 0, 1 or an empty string is returned. |
120+
| | If 0 is returned, it means that the window should be skipped |
121+
| | entirely during keyboard traversal. If 1, it means that the |
122+
| | window should receive the input focus as long as it is |
123+
| | viewable. And an empty string means that the traversal |
124+
| | scripts make the decision about whether or not to focus |
125+
| | on the window. |
125126
+-----------+--------------------------------------------------------------+
126127
| style | May be used to specify a custom widget style. |
127128
+-----------+--------------------------------------------------------------+

Doc/library/turtle.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ programmer to use all the commands, classes and methods interactively when using
3535
the module from within IDLE run with the ``-n`` switch.
3636

3737
The turtle module provides turtle graphics primitives, in both object-oriented
38-
and procedure-oriented ways. Because it uses :mod:`Tkinter` for the underlying
38+
and procedure-oriented ways. Because it uses :mod:`tkinter` for the underlying
3939
graphics, it needs a version of Python installed with Tk support.
4040

4141
The object-oriented interface uses essentially two+two classes:
4242

4343
1. The :class:`TurtleScreen` class defines graphics windows as a playground for
44-
the drawing turtles. Its constructor needs a :class:`Tkinter.Canvas` or a
44+
the drawing turtles. Its constructor needs a :class:`tkinter.Canvas` or a
4545
:class:`ScrolledCanvas` as argument. It should be used when :mod:`turtle` is
4646
used as part of some application.
4747

@@ -1998,7 +1998,7 @@ The public classes of the module :mod:`turtle`
19981998
.. class:: RawTurtle(canvas)
19991999
RawPen(canvas)
20002000

2001-
:param canvas: a :class:`Tkinter.Canvas`, a :class:`ScrolledCanvas` or a
2001+
:param canvas: a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a
20022002
:class:`TurtleScreen`
20032003

20042004
Create a turtle. The turtle has all methods described above as "methods of
@@ -2013,7 +2013,7 @@ The public classes of the module :mod:`turtle`
20132013

20142014
.. class:: TurtleScreen(cv)
20152015

2016-
:param cv: a :class:`Tkinter.Canvas`
2016+
:param cv: a :class:`tkinter.Canvas`
20172017

20182018
Provides screen oriented methods like :func:`setbg` etc. that are described
20192019
above.

Doc/using/mac.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ There are several options for building GUI applications on the Mac with Python.
143143
the foundation of most modern Mac development. Information on PyObjC is
144144
available from http://pyobjc.sourceforge.net.
145145

146-
The standard Python GUI toolkit is :mod:`Tkinter`, based on the cross-platform
146+
The standard Python GUI toolkit is :mod:`tkinter`, based on the cross-platform
147147
Tk toolkit (http://www.tcl.tk). An Aqua-native version of Tk is bundled with OS
148148
X by Apple, and the latest version can be downloaded and installed from
149149
http://www.activestate.com; it can also be built from source.

0 commit comments

Comments
 (0)