mirror of https://github.com/python/cpython.git
[3.11] gh-110631: Fix reST indentation in `Doc/library` (GH-110685) (#110737)
* [3.11] gh-110631: Fix reST indentation in `Doc/library` (GH-110685)
Fix wrong indentation in the Doc/library dir..
(cherry picked from commit bb7923f556
)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Fix merge glitch.
This commit is contained in:
parent
fd061a9bbe
commit
07471cda29
|
@ -206,7 +206,7 @@ In addition to these methods, lock objects can also be used via the
|
|||
|
||||
**Caveats:**
|
||||
|
||||
.. index:: pair: module; signal
|
||||
.. index:: pair: module; signal
|
||||
|
||||
* Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt`
|
||||
exception will be received by an arbitrary thread. (When the :mod:`signal`
|
||||
|
|
|
@ -58,6 +58,7 @@ The :mod:`binascii` module defines the following functions:
|
|||
data will raise :exc:`binascii.Error`.
|
||||
|
||||
Valid base64:
|
||||
|
||||
* Conforms to :rfc:`3548`.
|
||||
* Contains only characters from the base64 alphabet.
|
||||
* Contains no excess data after padding (including excess padding, newlines, etc.).
|
||||
|
|
|
@ -1697,22 +1697,21 @@ See :ref:`ctypes-callback-functions` for examples.
|
|||
Function prototypes created by these factory functions can be instantiated in
|
||||
different ways, depending on the type and number of the parameters in the call:
|
||||
|
||||
|
||||
.. function:: prototype(address)
|
||||
.. function:: prototype(address)
|
||||
:noindex:
|
||||
:module:
|
||||
|
||||
Returns a foreign function at the specified address which must be an integer.
|
||||
|
||||
|
||||
.. function:: prototype(callable)
|
||||
.. function:: prototype(callable)
|
||||
:noindex:
|
||||
:module:
|
||||
|
||||
Create a C callable function (a callback function) from a Python *callable*.
|
||||
|
||||
|
||||
.. function:: prototype(func_spec[, paramflags])
|
||||
.. function:: prototype(func_spec[, paramflags])
|
||||
:noindex:
|
||||
:module:
|
||||
|
||||
|
@ -1722,7 +1721,7 @@ different ways, depending on the type and number of the parameters in the call:
|
|||
as small integer. The second item is the shared library instance.
|
||||
|
||||
|
||||
.. function:: prototype(vtbl_index, name[, paramflags[, iid]])
|
||||
.. function:: prototype(vtbl_index, name[, paramflags[, iid]])
|
||||
:noindex:
|
||||
:module:
|
||||
|
||||
|
@ -1733,18 +1732,18 @@ different ways, depending on the type and number of the parameters in the call:
|
|||
|
||||
COM methods use a special calling convention: They require a pointer to
|
||||
the COM interface as first argument, in addition to those parameters that
|
||||
are specified in the :attr:`argtypes` tuple.
|
||||
are specified in the :attr:`!argtypes` tuple.
|
||||
|
||||
The optional *paramflags* parameter creates foreign function wrappers with much
|
||||
more functionality than the features described above.
|
||||
The optional *paramflags* parameter creates foreign function wrappers with much
|
||||
more functionality than the features described above.
|
||||
|
||||
*paramflags* must be a tuple of the same length as :attr:`argtypes`.
|
||||
*paramflags* must be a tuple of the same length as :attr:`~_FuncPtr.argtypes`.
|
||||
|
||||
Each item in this tuple contains further information about a parameter, it must
|
||||
be a tuple containing one, two, or three items.
|
||||
Each item in this tuple contains further information about a parameter, it must
|
||||
be a tuple containing one, two, or three items.
|
||||
|
||||
The first item is an integer containing a combination of direction
|
||||
flags for the parameter:
|
||||
The first item is an integer containing a combination of direction
|
||||
flags for the parameter:
|
||||
|
||||
1
|
||||
Specifies an input parameter to the function.
|
||||
|
@ -1755,12 +1754,13 @@ different ways, depending on the type and number of the parameters in the call:
|
|||
4
|
||||
Input parameter which defaults to the integer zero.
|
||||
|
||||
The optional second item is the parameter name as string. If this is specified,
|
||||
the foreign function can be called with named parameters.
|
||||
The optional second item is the parameter name as string. If this is specified,
|
||||
the foreign function can be called with named parameters.
|
||||
|
||||
The optional third item is the default value for this parameter.
|
||||
The optional third item is the default value for this parameter.
|
||||
|
||||
This example demonstrates how to wrap the Windows ``MessageBoxW`` function so
|
||||
|
||||
The following example demonstrates how to wrap the Windows ``MessageBoxW`` function so
|
||||
that it supports default parameters and named arguments. The C declaration from
|
||||
the windows header file is this::
|
||||
|
||||
|
|
|
@ -1774,7 +1774,7 @@ The following table lists mouse button constants used by :meth:`getmouse`:
|
|||
| .. data:: BUTTON_ALT | Control was down during button state change |
|
||||
+----------------------------------+---------------------------------------------+
|
||||
|
||||
.. versionchanged:: 3.10
|
||||
.. versionchanged:: 3.10
|
||||
The ``BUTTON5_*`` constants are now exposed if they are provided by the
|
||||
underlying curses library.
|
||||
|
||||
|
|
|
@ -556,14 +556,14 @@ more closely to the RFCs relevant to their domains.
|
|||
With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API of
|
||||
the email package is changed from the Python 3.2 API in the following ways:
|
||||
|
||||
* Setting a header on a :class:`~email.message.Message` results in that
|
||||
* Setting a header on a :class:`~email.message.Message` results in that
|
||||
header being parsed and a header object created.
|
||||
|
||||
* Fetching a header value from a :class:`~email.message.Message` results
|
||||
* Fetching a header value from a :class:`~email.message.Message` results
|
||||
in that header being parsed and a header object created and
|
||||
returned.
|
||||
|
||||
* Any header object, or any header that is refolded due to the
|
||||
* Any header object, or any header that is refolded due to the
|
||||
policy settings, is folded using an algorithm that fully implements the
|
||||
RFC folding algorithms, including knowing where encoded words are required
|
||||
and allowed.
|
||||
|
|
|
@ -1157,7 +1157,7 @@ are always available. They are listed here in alphabetical order.
|
|||
|
||||
See also :func:`format` for more information.
|
||||
|
||||
.. index::
|
||||
.. index::
|
||||
single: file object; open() built-in function
|
||||
|
||||
.. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
|
||||
|
|
|
@ -1435,6 +1435,7 @@ generator to be determined easily.
|
|||
Get current state of a generator-iterator.
|
||||
|
||||
Possible states are:
|
||||
|
||||
* GEN_CREATED: Waiting to start execution.
|
||||
* GEN_RUNNING: Currently being executed by the interpreter.
|
||||
* GEN_SUSPENDED: Currently suspended at a yield expression.
|
||||
|
@ -1450,6 +1451,7 @@ generator to be determined easily.
|
|||
``cr_frame`` attributes.
|
||||
|
||||
Possible states are:
|
||||
|
||||
* CORO_CREATED: Waiting to start execution.
|
||||
* CORO_RUNNING: Currently being executed by the interpreter.
|
||||
* CORO_SUSPENDED: Currently suspended at an await expression.
|
||||
|
|
|
@ -253,7 +253,7 @@ The implementation of I/O streams is organized as a hierarchy of classes. First
|
|||
specify the various categories of streams, then concrete classes providing the
|
||||
standard stream implementations.
|
||||
|
||||
.. note::
|
||||
.. note::
|
||||
|
||||
The abstract base classes also provide default implementations of some
|
||||
methods in order to help implementation of concrete stream classes. For
|
||||
|
|
|
@ -543,7 +543,7 @@ valid keyword parameter name, and so will not clash with the names of
|
|||
the keyword arguments used in the call. The ``'()'`` also serves as a
|
||||
mnemonic that the corresponding value is a callable.
|
||||
|
||||
.. versionchanged:: 3.11
|
||||
.. versionchanged:: 3.11
|
||||
The ``filters`` member of ``handlers`` and ``loggers`` can take
|
||||
filter instances in addition to ids.
|
||||
|
||||
|
|
|
@ -333,13 +333,16 @@ the key ``"id"``, and may contain additional keys to specify filter-dependent
|
|||
options. Valid filter IDs are as follows:
|
||||
|
||||
* Compression filters:
|
||||
|
||||
* :const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)
|
||||
* :const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:`FORMAT_RAW`)
|
||||
|
||||
* Delta filter:
|
||||
|
||||
* :const:`FILTER_DELTA`
|
||||
|
||||
* Branch-Call-Jump (BCJ) filters:
|
||||
|
||||
* :const:`FILTER_X86`
|
||||
* :const:`FILTER_IA64`
|
||||
* :const:`FILTER_ARM`
|
||||
|
@ -354,20 +357,20 @@ delta or BCJ filters.
|
|||
Compression filters support the following options (specified as additional
|
||||
entries in the dictionary representing the filter):
|
||||
|
||||
* ``preset``: A compression preset to use as a source of default values for
|
||||
* ``preset``: A compression preset to use as a source of default values for
|
||||
options that are not specified explicitly.
|
||||
* ``dict_size``: Dictionary size in bytes. This should be between 4 KiB and
|
||||
* ``dict_size``: Dictionary size in bytes. This should be between 4 KiB and
|
||||
1.5 GiB (inclusive).
|
||||
* ``lc``: Number of literal context bits.
|
||||
* ``lp``: Number of literal position bits. The sum ``lc + lp`` must be at
|
||||
* ``lc``: Number of literal context bits.
|
||||
* ``lp``: Number of literal position bits. The sum ``lc + lp`` must be at
|
||||
most 4.
|
||||
* ``pb``: Number of position bits; must be at most 4.
|
||||
* ``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`.
|
||||
* ``nice_len``: What should be considered a "nice length" for a match.
|
||||
* ``pb``: Number of position bits; must be at most 4.
|
||||
* ``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`.
|
||||
* ``nice_len``: What should be considered a "nice length" for a match.
|
||||
This should be 273 or less.
|
||||
* ``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`,
|
||||
* ``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`,
|
||||
:const:`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`.
|
||||
* ``depth``: Maximum search depth used by match finder. 0 (default) means to
|
||||
* ``depth``: Maximum search depth used by match finder. 0 (default) means to
|
||||
select automatically based on other filter options.
|
||||
|
||||
The delta filter stores the differences between bytes, producing more repetitive
|
||||
|
|
|
@ -160,20 +160,20 @@ refer to ``MyIntegral`` and ``OtherTypeIKnowAbout`` as
|
|||
of :class:`Complex` (``a : A <: Complex``), and ``b : B <:
|
||||
Complex``. I'll consider ``a + b``:
|
||||
|
||||
1. If ``A`` defines an :meth:`__add__` which accepts ``b``, all is
|
||||
1. If ``A`` defines an :meth:`__add__` which accepts ``b``, all is
|
||||
well.
|
||||
2. If ``A`` falls back to the boilerplate code, and it were to
|
||||
2. If ``A`` falls back to the boilerplate code, and it were to
|
||||
return a value from :meth:`__add__`, we'd miss the possibility
|
||||
that ``B`` defines a more intelligent :meth:`__radd__`, so the
|
||||
boilerplate should return :const:`NotImplemented` from
|
||||
:meth:`__add__`. (Or ``A`` may not implement :meth:`__add__` at
|
||||
all.)
|
||||
3. Then ``B``'s :meth:`__radd__` gets a chance. If it accepts
|
||||
3. Then ``B``'s :meth:`__radd__` gets a chance. If it accepts
|
||||
``a``, all is well.
|
||||
4. If it falls back to the boilerplate, there are no more possible
|
||||
4. If it falls back to the boilerplate, there are no more possible
|
||||
methods to try, so this is where the default implementation
|
||||
should live.
|
||||
5. If ``B <: A``, Python tries ``B.__radd__`` before
|
||||
5. If ``B <: A``, Python tries ``B.__radd__`` before
|
||||
``A.__add__``. This is ok, because it was implemented with
|
||||
knowledge of ``A``, so it can handle those instances before
|
||||
delegating to :class:`Complex`.
|
||||
|
|
|
@ -135,10 +135,10 @@ the output by. This only applies when ``-o`` is not supplied.
|
|||
|
||||
``-m`` specifies that a module is being profiled instead of a script.
|
||||
|
||||
.. versionadded:: 3.7
|
||||
.. versionadded:: 3.7
|
||||
Added the ``-m`` option to :mod:`cProfile`.
|
||||
|
||||
.. versionadded:: 3.8
|
||||
.. versionadded:: 3.8
|
||||
Added the ``-m`` option to :mod:`profile`.
|
||||
|
||||
The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of methods
|
||||
|
|
|
@ -94,7 +94,7 @@ Two additional methods are supported:
|
|||
Restrictions
|
||||
------------
|
||||
|
||||
.. index::
|
||||
.. index::
|
||||
pair: module; dbm.ndbm
|
||||
pair: module; dbm.gnu
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ By default, an object is considered true unless its class defines either a
|
|||
returns zero, when called with the object. [1]_ Here are most of the built-in
|
||||
objects considered false:
|
||||
|
||||
.. index::
|
||||
.. index::
|
||||
single: None (Built-in object)
|
||||
single: False (Built-in object)
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ literal text, it can be escaped by doubling: ``{{`` and ``}}``.
|
|||
|
||||
The grammar for a replacement field is as follows:
|
||||
|
||||
.. productionlist:: format-string
|
||||
.. productionlist:: format-string
|
||||
replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}"
|
||||
field_name: arg_name ("." `attribute_name` | "[" `element_index` "]")*
|
||||
arg_name: [`identifier` | `digit`+]
|
||||
|
@ -332,30 +332,30 @@ affect the :func:`format` function.
|
|||
|
||||
The meaning of the various alignment options is as follows:
|
||||
|
||||
.. index::
|
||||
.. index::
|
||||
single: < (less); in string formatting
|
||||
single: > (greater); in string formatting
|
||||
single: = (equals); in string formatting
|
||||
single: ^ (caret); in string formatting
|
||||
|
||||
+---------+----------------------------------------------------------+
|
||||
| Option | Meaning |
|
||||
+=========+==========================================================+
|
||||
| ``'<'`` | Forces the field to be left-aligned within the available |
|
||||
| | space (this is the default for most objects). |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'>'`` | Forces the field to be right-aligned within the |
|
||||
| | available space (this is the default for numbers). |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'='`` | Forces the padding to be placed after the sign (if any) |
|
||||
| | but before the digits. This is used for printing fields |
|
||||
| | in the form '+000000120'. This alignment option is only |
|
||||
| | valid for numeric types. It becomes the default for |
|
||||
| | numbers when '0' immediately precedes the field width. |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'^'`` | Forces the field to be centered within the available |
|
||||
| | space. |
|
||||
+---------+----------------------------------------------------------+
|
||||
+---------+----------------------------------------------------------+
|
||||
| Option | Meaning |
|
||||
+=========+==========================================================+
|
||||
| ``'<'`` | Forces the field to be left-aligned within the available |
|
||||
| | space (this is the default for most objects). |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'>'`` | Forces the field to be right-aligned within the |
|
||||
| | available space (this is the default for numbers). |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'='`` | Forces the padding to be placed after the sign (if any) |
|
||||
| | but before the digits. This is used for printing fields |
|
||||
| | in the form '+000000120'. This alignment option is only |
|
||||
| | valid for numeric types. It becomes the default for |
|
||||
| | numbers when '0' immediately precedes the field width. |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'^'`` | Forces the field to be centered within the available |
|
||||
| | space. |
|
||||
+---------+----------------------------------------------------------+
|
||||
|
||||
Note that unless a minimum field width is defined, the field width will always
|
||||
be the same size as the data to fill it, so that the alignment option has no
|
||||
|
@ -364,23 +364,23 @@ meaning in this case.
|
|||
The *sign* option is only valid for number types, and can be one of the
|
||||
following:
|
||||
|
||||
.. index::
|
||||
.. index::
|
||||
single: + (plus); in string formatting
|
||||
single: - (minus); in string formatting
|
||||
single: space; in string formatting
|
||||
|
||||
+---------+----------------------------------------------------------+
|
||||
| Option | Meaning |
|
||||
+=========+==========================================================+
|
||||
| ``'+'`` | indicates that a sign should be used for both |
|
||||
| | positive as well as negative numbers. |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'-'`` | indicates that a sign should be used only for negative |
|
||||
| | numbers (this is the default behavior). |
|
||||
+---------+----------------------------------------------------------+
|
||||
| space | indicates that a leading space should be used on |
|
||||
| | positive numbers, and a minus sign on negative numbers. |
|
||||
+---------+----------------------------------------------------------+
|
||||
+---------+----------------------------------------------------------+
|
||||
| Option | Meaning |
|
||||
+=========+==========================================================+
|
||||
| ``'+'`` | indicates that a sign should be used for both |
|
||||
| | positive as well as negative numbers. |
|
||||
+---------+----------------------------------------------------------+
|
||||
| ``'-'`` | indicates that a sign should be used only for negative |
|
||||
| | numbers (this is the default behavior). |
|
||||
+---------+----------------------------------------------------------+
|
||||
| space | indicates that a leading space should be used on |
|
||||
| | positive numbers, and a minus sign on negative numbers. |
|
||||
+---------+----------------------------------------------------------+
|
||||
|
||||
|
||||
.. index:: single: z; in string formatting
|
||||
|
|
|
@ -744,7 +744,7 @@ the timeout expires before the process exits.
|
|||
|
||||
Exceptions defined in this module all inherit from :exc:`SubprocessError`.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
.. versionadded:: 3.3
|
||||
The :exc:`SubprocessError` base class was added.
|
||||
|
||||
.. _subprocess-security:
|
||||
|
|
|
@ -533,23 +533,23 @@ interpreter will fail.
|
|||
|
||||
A number of special cases exist:
|
||||
|
||||
* Tcl/Tk libraries can be built so they are not thread-aware. In this case,
|
||||
* Tcl/Tk libraries can be built so they are not thread-aware. In this case,
|
||||
:mod:`tkinter` calls the library from the originating Python thread, even
|
||||
if this is different than the thread that created the Tcl interpreter. A global
|
||||
lock ensures only one call occurs at a time.
|
||||
|
||||
* While :mod:`tkinter` allows you to create more than one instance of a :class:`Tk`
|
||||
* While :mod:`tkinter` allows you to create more than one instance of a :class:`Tk`
|
||||
object (with its own interpreter), all interpreters that are part of the same
|
||||
thread share a common event queue, which gets ugly fast. In practice, don't create
|
||||
more than one instance of :class:`Tk` at a time. Otherwise, it's best to create
|
||||
them in separate threads and ensure you're running a thread-aware Tcl/Tk build.
|
||||
|
||||
* Blocking event handlers are not the only way to prevent the Tcl interpreter from
|
||||
* Blocking event handlers are not the only way to prevent the Tcl interpreter from
|
||||
reentering the event loop. It is even possible to run multiple nested event loops
|
||||
or abandon the event loop entirely. If you're doing anything tricky when it comes
|
||||
to events or threads, be aware of these possibilities.
|
||||
|
||||
* There are a few select :mod:`tkinter` functions that presently work only when
|
||||
* There are a few select :mod:`tkinter` functions that presently work only when
|
||||
called from the thread that created the Tcl interpreter.
|
||||
|
||||
|
||||
|
|
|
@ -104,33 +104,33 @@ Standard Options
|
|||
|
||||
All the :mod:`ttk` Widgets accept the following options:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+===========+==============================================================+
|
||||
| class | Specifies the window class. The class is used when querying |
|
||||
| | the option database for the window's other options, to |
|
||||
| | determine the default bindtags for the window, and to select |
|
||||
| | the widget's default layout and style. This option is |
|
||||
| | read-only, and may only be specified when the window is |
|
||||
| | created. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| cursor | Specifies the mouse cursor to be used for the widget. If set |
|
||||
| | to the empty string (the default), the cursor is inherited |
|
||||
| | for the parent widget. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| takefocus | Determines whether the window accepts the focus during |
|
||||
| | keyboard traversal. 0, 1 or an empty string is returned. |
|
||||
| | If 0 is returned, it means that the window should be skipped |
|
||||
| | entirely during keyboard traversal. If 1, it means that the |
|
||||
| | window should receive the input focus as long as it is |
|
||||
| | viewable. And an empty string means that the traversal |
|
||||
| | scripts make the decision about whether or not to focus |
|
||||
| | on the window. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| style | May be used to specify a custom widget style. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+===========+==============================================================+
|
||||
| class | Specifies the window class. The class is used when querying |
|
||||
| | the option database for the window's other options, to |
|
||||
| | determine the default bindtags for the window, and to select |
|
||||
| | the widget's default layout and style. This option is |
|
||||
| | read-only, and may only be specified when the window is |
|
||||
| | created. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| cursor | Specifies the mouse cursor to be used for the widget. If set |
|
||||
| | to the empty string (the default), the cursor is inherited |
|
||||
| | for the parent widget. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| takefocus | Determines whether the window accepts the focus during |
|
||||
| | keyboard traversal. 0, 1 or an empty string is returned. |
|
||||
| | If 0 is returned, it means that the window should be skipped |
|
||||
| | entirely during keyboard traversal. If 1, it means that the |
|
||||
| | window should receive the input focus as long as it is |
|
||||
| | viewable. And an empty string means that the traversal |
|
||||
| | scripts make the decision about whether or not to focus |
|
||||
| | on the window. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| style | May be used to specify a custom widget style. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
|
||||
|
||||
Scrollable Widget Options
|
||||
|
@ -139,24 +139,24 @@ Scrollable Widget Options
|
|||
The following options are supported by widgets that are controlled by a
|
||||
scrollbar.
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+----------------+---------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+================+=========================================================+
|
||||
| xscrollcommand | Used to communicate with horizontal scrollbars. |
|
||||
| | |
|
||||
| | When the view in the widget's window change, the widget |
|
||||
| | will generate a Tcl command based on the scrollcommand. |
|
||||
| | |
|
||||
| | Usually this option consists of the method |
|
||||
| | :meth:`Scrollbar.set` of some scrollbar. This will cause|
|
||||
| | the scrollbar to be updated whenever the view in the |
|
||||
| | window changes. |
|
||||
+----------------+---------------------------------------------------------+
|
||||
| yscrollcommand | Used to communicate with vertical scrollbars. |
|
||||
| | For some more information, see above. |
|
||||
+----------------+---------------------------------------------------------+
|
||||
+----------------+---------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+================+=========================================================+
|
||||
| xscrollcommand | Used to communicate with horizontal scrollbars. |
|
||||
| | |
|
||||
| | When the view in the widget's window change, the widget |
|
||||
| | will generate a Tcl command based on the scrollcommand. |
|
||||
| | |
|
||||
| | Usually this option consists of the method |
|
||||
| | :meth:`Scrollbar.set` of some scrollbar. This will cause|
|
||||
| | the scrollbar to be updated whenever the view in the |
|
||||
| | window changes. |
|
||||
+----------------+---------------------------------------------------------+
|
||||
| yscrollcommand | Used to communicate with vertical scrollbars. |
|
||||
| | For some more information, see above. |
|
||||
+----------------+---------------------------------------------------------+
|
||||
|
||||
|
||||
Label Options
|
||||
|
@ -165,93 +165,93 @@ Label Options
|
|||
The following options are supported by labels, buttons and other button-like
|
||||
widgets.
|
||||
|
||||
.. tabularcolumns:: |l|p{0.7\linewidth}|
|
||||
.. tabularcolumns:: |l|p{0.7\linewidth}|
|
||||
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+==============+===========================================================+
|
||||
| text | Specifies a text string to be displayed inside the widget.|
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| textvariable | Specifies a name whose value will be used in place of the |
|
||||
| | text option resource. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| underline | If set, specifies the index (0-based) of a character to |
|
||||
| | underline in the text string. The underline character is |
|
||||
| | used for mnemonic activation. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| image | Specifies an image to display. This is a list of 1 or more|
|
||||
| | elements. The first element is the default image name. The|
|
||||
| | rest of the list if a sequence of statespec/value pairs as|
|
||||
| | defined by :meth:`Style.map`, specifying different images |
|
||||
| | to use when the widget is in a particular state or a |
|
||||
| | combination of states. All images in the list should have |
|
||||
| | the same size. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| compound | Specifies how to display the image relative to the text, |
|
||||
| | in the case both text and images options are present. |
|
||||
| | Valid values are: |
|
||||
| | |
|
||||
| | * text: display text only |
|
||||
| | * image: display image only |
|
||||
| | * top, bottom, left, right: display image above, below, |
|
||||
| | left of, or right of the text, respectively. |
|
||||
| | * none: the default. display the image if present, |
|
||||
| | otherwise the text. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| width | If greater than zero, specifies how much space, in |
|
||||
| | character widths, to allocate for the text label, if less |
|
||||
| | than zero, specifies a minimum width. If zero or |
|
||||
| | unspecified, the natural width of the text label is used. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+==============+===========================================================+
|
||||
| text | Specifies a text string to be displayed inside the widget.|
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| textvariable | Specifies a name whose value will be used in place of the |
|
||||
| | text option resource. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| underline | If set, specifies the index (0-based) of a character to |
|
||||
| | underline in the text string. The underline character is |
|
||||
| | used for mnemonic activation. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| image | Specifies an image to display. This is a list of 1 or more|
|
||||
| | elements. The first element is the default image name. The|
|
||||
| | rest of the list if a sequence of statespec/value pairs as|
|
||||
| | defined by :meth:`Style.map`, specifying different images |
|
||||
| | to use when the widget is in a particular state or a |
|
||||
| | combination of states. All images in the list should have |
|
||||
| | the same size. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| compound | Specifies how to display the image relative to the text, |
|
||||
| | in the case both text and images options are present. |
|
||||
| | Valid values are: |
|
||||
| | |
|
||||
| | * text: display text only |
|
||||
| | * image: display image only |
|
||||
| | * top, bottom, left, right: display image above, below, |
|
||||
| | left of, or right of the text, respectively. |
|
||||
| | * none: the default. display the image if present, |
|
||||
| | otherwise the text. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
| width | If greater than zero, specifies how much space, in |
|
||||
| | character widths, to allocate for the text label, if less |
|
||||
| | than zero, specifies a minimum width. If zero or |
|
||||
| | unspecified, the natural width of the text label is used. |
|
||||
+--------------+-----------------------------------------------------------+
|
||||
|
||||
|
||||
Compatibility Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+--------+----------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+========+================================================================+
|
||||
| state | May be set to "normal" or "disabled" to control the "disabled" |
|
||||
| | state bit. This is a write-only option: setting it changes the |
|
||||
| | widget state, but the :meth:`Widget.state` method does not |
|
||||
| | affect this option. |
|
||||
+--------+----------------------------------------------------------------+
|
||||
+--------+----------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+========+================================================================+
|
||||
| state | May be set to "normal" or "disabled" to control the "disabled" |
|
||||
| | state bit. This is a write-only option: setting it changes the |
|
||||
| | widget state, but the :meth:`Widget.state` method does not |
|
||||
| | affect this option. |
|
||||
+--------+----------------------------------------------------------------+
|
||||
|
||||
Widget States
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
The widget state is a bitmap of independent state flags.
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+------------+-------------------------------------------------------------+
|
||||
| Flag | Description |
|
||||
+============+=============================================================+
|
||||
| active | The mouse cursor is over the widget and pressing a mouse |
|
||||
| | button will cause some action to occur |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| disabled | Widget is disabled under program control |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| focus | Widget has keyboard focus |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| pressed | Widget is being pressed |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| selected | "On", "true", or "current" for things like Checkbuttons and |
|
||||
| | radiobuttons |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| background | Windows and Mac have a notion of an "active" or foreground |
|
||||
| | window. The *background* state is set for widgets in a |
|
||||
| | background window, and cleared for those in the foreground |
|
||||
| | window |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| readonly | Widget should not allow user modification |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| alternate | A widget-specific alternate display format |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| invalid | The widget's value is invalid |
|
||||
+------------+-------------------------------------------------------------+
|
||||
+------------+-------------------------------------------------------------+
|
||||
| Flag | Description |
|
||||
+============+=============================================================+
|
||||
| active | The mouse cursor is over the widget and pressing a mouse |
|
||||
| | button will cause some action to occur |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| disabled | Widget is disabled under program control |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| focus | Widget has keyboard focus |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| pressed | Widget is being pressed |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| selected | "On", "true", or "current" for things like Checkbuttons and |
|
||||
| | radiobuttons |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| background | Windows and Mac have a notion of an "active" or foreground |
|
||||
| | window. The *background* state is set for widgets in a |
|
||||
| | background window, and cleared for those in the foreground |
|
||||
| | window |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| readonly | Widget should not allow user modification |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| alternate | A widget-specific alternate display format |
|
||||
+------------+-------------------------------------------------------------+
|
||||
| invalid | The widget's value is invalid |
|
||||
+------------+-------------------------------------------------------------+
|
||||
|
||||
A state specification is a sequence of state names, optionally prefixed with
|
||||
an exclamation point indicating that the bit is off.
|
||||
|
@ -311,43 +311,43 @@ Options
|
|||
|
||||
This widget accepts the following specific options:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+=================+========================================================+
|
||||
| exportselection | Boolean value. If set, the widget selection is linked |
|
||||
| | to the Window Manager selection (which can be returned |
|
||||
| | by invoking Misc.selection_get, for example). |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| justify | Specifies how the text is aligned within the widget. |
|
||||
| | One of "left", "center", or "right". |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| height | Specifies the height of the pop-down listbox, in rows. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| postcommand | A script (possibly registered with Misc.register) that |
|
||||
| | is called immediately before displaying the values. It |
|
||||
| | may specify which values to display. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| state | One of "normal", "readonly", or "disabled". In the |
|
||||
| | "readonly" state, the value may not be edited directly,|
|
||||
| | and the user can only selection of the values from the |
|
||||
| | dropdown list. In the "normal" state, the text field is|
|
||||
| | directly editable. In the "disabled" state, no |
|
||||
| | interaction is possible. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| textvariable | Specifies a name whose value is linked to the widget |
|
||||
| | value. Whenever the value associated with that name |
|
||||
| | changes, the widget value is updated, and vice versa. |
|
||||
| | See :class:`tkinter.StringVar`. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| values | Specifies the list of values to display in the |
|
||||
| | drop-down listbox. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| width | Specifies an integer value indicating the desired width|
|
||||
| | of the entry window, in average-size characters of the |
|
||||
| | widget's font. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+=================+========================================================+
|
||||
| exportselection | Boolean value. If set, the widget selection is linked |
|
||||
| | to the Window Manager selection (which can be returned |
|
||||
| | by invoking Misc.selection_get, for example). |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| justify | Specifies how the text is aligned within the widget. |
|
||||
| | One of "left", "center", or "right". |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| height | Specifies the height of the pop-down listbox, in rows. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| postcommand | A script (possibly registered with Misc.register) that |
|
||||
| | is called immediately before displaying the values. It |
|
||||
| | may specify which values to display. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| state | One of "normal", "readonly", or "disabled". In the |
|
||||
| | "readonly" state, the value may not be edited directly,|
|
||||
| | and the user can only selection of the values from the |
|
||||
| | dropdown list. In the "normal" state, the text field is|
|
||||
| | directly editable. In the "disabled" state, no |
|
||||
| | interaction is possible. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| textvariable | Specifies a name whose value is linked to the widget |
|
||||
| | value. Whenever the value associated with that name |
|
||||
| | changes, the widget value is updated, and vice versa. |
|
||||
| | See :class:`tkinter.StringVar`. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| values | Specifies the list of values to display in the |
|
||||
| | drop-down listbox. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
| width | Specifies an integer value indicating the desired width|
|
||||
| | of the entry window, in average-size characters of the |
|
||||
| | widget's font. |
|
||||
+-----------------+--------------------------------------------------------+
|
||||
|
||||
|
||||
Virtual events
|
||||
|
@ -397,7 +397,7 @@ Options
|
|||
|
||||
This widget accepts the following specific options:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+----------------------+------------------------------------------------------+
|
||||
| Option | Description |
|
||||
|
@ -473,25 +473,25 @@ Options
|
|||
|
||||
This widget accepts the following specific options:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+---------+----------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+=========+================================================================+
|
||||
| height | If present and greater than zero, specifies the desired height |
|
||||
| | of the pane area (not including internal padding or tabs). |
|
||||
| | Otherwise, the maximum height of all panes is used. |
|
||||
+---------+----------------------------------------------------------------+
|
||||
| padding | Specifies the amount of extra space to add around the outside |
|
||||
| | of the notebook. The padding is a list up to four length |
|
||||
| | specifications left top right bottom. If fewer than four |
|
||||
| | elements are specified, bottom defaults to top, right defaults |
|
||||
| | to left, and top defaults to left. |
|
||||
+---------+----------------------------------------------------------------+
|
||||
| width | If present and greater than zero, specified the desired width |
|
||||
| | of the pane area (not including internal padding). Otherwise, |
|
||||
| | the maximum width of all panes is used. |
|
||||
+---------+----------------------------------------------------------------+
|
||||
+---------+----------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+=========+================================================================+
|
||||
| height | If present and greater than zero, specifies the desired height |
|
||||
| | of the pane area (not including internal padding or tabs). |
|
||||
| | Otherwise, the maximum height of all panes is used. |
|
||||
+---------+----------------------------------------------------------------+
|
||||
| padding | Specifies the amount of extra space to add around the outside |
|
||||
| | of the notebook. The padding is a list up to four length |
|
||||
| | specifications left top right bottom. If fewer than four |
|
||||
| | elements are specified, bottom defaults to top, right defaults |
|
||||
| | to left, and top defaults to left. |
|
||||
+---------+----------------------------------------------------------------+
|
||||
| width | If present and greater than zero, specified the desired width |
|
||||
| | of the pane area (not including internal padding). Otherwise, |
|
||||
| | the maximum width of all panes is used. |
|
||||
+---------+----------------------------------------------------------------+
|
||||
|
||||
|
||||
Tab Options
|
||||
|
@ -499,39 +499,39 @@ Tab Options
|
|||
|
||||
There are also specific options for tabs:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+===========+==============================================================+
|
||||
| state | Either "normal", "disabled" or "hidden". If "disabled", then |
|
||||
| | the tab is not selectable. If "hidden", then the tab is not |
|
||||
| | shown. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| sticky | Specifies how the child window is positioned within the pane |
|
||||
| | area. Value is a string containing zero or more of the |
|
||||
| | characters "n", "s", "e" or "w". Each letter refers to a |
|
||||
| | side (north, south, east or west) that the child window will |
|
||||
| | stick to, as per the :meth:`grid` geometry manager. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| padding | Specifies the amount of extra space to add between the |
|
||||
| | notebook and this pane. Syntax is the same as for the option |
|
||||
| | padding used by this widget. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| text | Specifies a text to be displayed in the tab. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| image | Specifies an image to display in the tab. See the option |
|
||||
| | image described in :class:`Widget`. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| compound | Specifies how to display the image relative to the text, in |
|
||||
| | the case both options text and image are present. See |
|
||||
| | `Label Options`_ for legal values. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| underline | Specifies the index (0-based) of a character to underline in |
|
||||
| | the text string. The underlined character is used for |
|
||||
| | mnemonic activation if :meth:`Notebook.enable_traversal` is |
|
||||
| | called. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+===========+==============================================================+
|
||||
| state | Either "normal", "disabled" or "hidden". If "disabled", then |
|
||||
| | the tab is not selectable. If "hidden", then the tab is not |
|
||||
| | shown. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| sticky | Specifies how the child window is positioned within the pane |
|
||||
| | area. Value is a string containing zero or more of the |
|
||||
| | characters "n", "s", "e" or "w". Each letter refers to a |
|
||||
| | side (north, south, east or west) that the child window will |
|
||||
| | stick to, as per the :meth:`grid` geometry manager. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| padding | Specifies the amount of extra space to add between the |
|
||||
| | notebook and this pane. Syntax is the same as for the option |
|
||||
| | padding used by this widget. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| text | Specifies a text to be displayed in the tab. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| image | Specifies an image to display in the tab. See the option |
|
||||
| | image described in :class:`Widget`. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| compound | Specifies how to display the image relative to the text, in |
|
||||
| | the case both options text and image are present. See |
|
||||
| | `Label Options`_ for legal values. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
| underline | Specifies the index (0-based) of a character to underline in |
|
||||
| | the text string. The underlined character is used for |
|
||||
| | mnemonic activation if :meth:`Notebook.enable_traversal` is |
|
||||
| | called. |
|
||||
+-----------+--------------------------------------------------------------+
|
||||
|
||||
|
||||
Tab Identifiers
|
||||
|
@ -663,36 +663,36 @@ Options
|
|||
|
||||
This widget accepts the following specific options:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+----------+---------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+==========+===============================================================+
|
||||
| orient | One of "horizontal" or "vertical". Specifies the orientation |
|
||||
| | of the progress bar. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| length | Specifies the length of the long axis of the progress bar |
|
||||
| | (width if horizontal, height if vertical). |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| mode | One of "determinate" or "indeterminate". |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| maximum | A number specifying the maximum value. Defaults to 100. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| value | The current value of the progress bar. In "determinate" mode, |
|
||||
| | this represents the amount of work completed. In |
|
||||
| | "indeterminate" mode, it is interpreted as modulo *maximum*; |
|
||||
| | that is, the progress bar completes one "cycle" when its value|
|
||||
| | increases by *maximum*. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| variable | A name which is linked to the option value. If specified, the |
|
||||
| | value of the progress bar is automatically set to the value of|
|
||||
| | this name whenever the latter is modified. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| phase | Read-only option. The widget periodically increments the value|
|
||||
| | of this option whenever its value is greater than 0 and, in |
|
||||
| | determinate mode, less than maximum. This option may be used |
|
||||
| | by the current theme to provide additional animation effects. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
+----------+---------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+==========+===============================================================+
|
||||
| orient | One of "horizontal" or "vertical". Specifies the orientation |
|
||||
| | of the progress bar. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| length | Specifies the length of the long axis of the progress bar |
|
||||
| | (width if horizontal, height if vertical). |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| mode | One of "determinate" or "indeterminate". |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| maximum | A number specifying the maximum value. Defaults to 100. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| value | The current value of the progress bar. In "determinate" mode, |
|
||||
| | this represents the amount of work completed. In |
|
||||
| | "indeterminate" mode, it is interpreted as modulo *maximum*; |
|
||||
| | that is, the progress bar completes one "cycle" when its value|
|
||||
| | increases by *maximum*. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| variable | A name which is linked to the option value. If specified, the |
|
||||
| | value of the progress bar is automatically set to the value of|
|
||||
| | this name whenever the latter is modified. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
| phase | Read-only option. The widget periodically increments the value|
|
||||
| | of this option whenever its value is greater than 0 and, in |
|
||||
| | determinate mode, less than maximum. This option may be used |
|
||||
| | by the current theme to provide additional animation effects. |
|
||||
+----------+---------------------------------------------------------------+
|
||||
|
||||
|
||||
ttk.Progressbar
|
||||
|
@ -734,14 +734,14 @@ Options
|
|||
|
||||
This widget accepts the following specific option:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+--------+----------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+========+================================================================+
|
||||
| orient | One of "horizontal" or "vertical". Specifies the orientation of|
|
||||
| | the separator. |
|
||||
+--------+----------------------------------------------------------------+
|
||||
+--------+----------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+========+================================================================+
|
||||
| orient | One of "horizontal" or "vertical". Specifies the orientation of|
|
||||
| | the separator. |
|
||||
+--------+----------------------------------------------------------------+
|
||||
|
||||
|
||||
Sizegrip
|
||||
|
@ -802,49 +802,49 @@ Options
|
|||
|
||||
This widget accepts the following specific options:
|
||||
|
||||
.. tabularcolumns:: |l|p{0.7\linewidth}|
|
||||
.. tabularcolumns:: |l|p{0.7\linewidth}|
|
||||
|
||||
+----------------+--------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+================+========================================================+
|
||||
| columns | A list of column identifiers, specifying the number of |
|
||||
| | columns and their names. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| displaycolumns | A list of column identifiers (either symbolic or |
|
||||
| | integer indices) specifying which data columns are |
|
||||
| | displayed and the order in which they appear, or the |
|
||||
| | string "#all". |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| height | Specifies the number of rows which should be visible. |
|
||||
| | Note: the requested width is determined from the sum |
|
||||
| | of the column widths. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| padding | Specifies the internal padding for the widget. The |
|
||||
| | padding is a list of up to four length specifications. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| selectmode | Controls how the built-in class bindings manage the |
|
||||
| | selection. One of "extended", "browse" or "none". |
|
||||
| | If set to "extended" (the default), multiple items may |
|
||||
| | be selected. If "browse", only a single item will be |
|
||||
| | selected at a time. If "none", the selection will not |
|
||||
| | be changed. |
|
||||
| | |
|
||||
| | Note that the application code and tag bindings can set|
|
||||
| | the selection however they wish, regardless of the |
|
||||
| | value of this option. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| show | A list containing zero or more of the following values,|
|
||||
| | specifying which elements of the tree to display. |
|
||||
| | |
|
||||
| | * tree: display tree labels in column #0. |
|
||||
| | * headings: display the heading row. |
|
||||
| | |
|
||||
| | The default is "tree headings", i.e., show all |
|
||||
| | elements. |
|
||||
| | |
|
||||
| | **Note**: Column #0 always refers to the tree column, |
|
||||
| | even if show="tree" is not specified. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
+----------------+--------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+================+========================================================+
|
||||
| columns | A list of column identifiers, specifying the number of |
|
||||
| | columns and their names. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| displaycolumns | A list of column identifiers (either symbolic or |
|
||||
| | integer indices) specifying which data columns are |
|
||||
| | displayed and the order in which they appear, or the |
|
||||
| | string "#all". |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| height | Specifies the number of rows which should be visible. |
|
||||
| | Note: the requested width is determined from the sum |
|
||||
| | of the column widths. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| padding | Specifies the internal padding for the widget. The |
|
||||
| | padding is a list of up to four length specifications. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| selectmode | Controls how the built-in class bindings manage the |
|
||||
| | selection. One of "extended", "browse" or "none". |
|
||||
| | If set to "extended" (the default), multiple items may |
|
||||
| | be selected. If "browse", only a single item will be |
|
||||
| | selected at a time. If "none", the selection will not |
|
||||
| | be changed. |
|
||||
| | |
|
||||
| | Note that the application code and tag bindings can set|
|
||||
| | the selection however they wish, regardless of the |
|
||||
| | value of this option. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
| show | A list containing zero or more of the following values,|
|
||||
| | specifying which elements of the tree to display. |
|
||||
| | |
|
||||
| | * tree: display tree labels in column #0. |
|
||||
| | * headings: display the heading row. |
|
||||
| | |
|
||||
| | The default is "tree headings", i.e., show all |
|
||||
| | elements. |
|
||||
| | |
|
||||
| | **Note**: Column #0 always refers to the tree column, |
|
||||
| | even if show="tree" is not specified. |
|
||||
+----------------+--------------------------------------------------------+
|
||||
|
||||
|
||||
Item Options
|
||||
|
@ -853,27 +853,27 @@ Item Options
|
|||
The following item options may be specified for items in the insert and item
|
||||
widget commands.
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+--------+---------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+========+===============================================================+
|
||||
| text | The textual label to display for the item. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| image | A Tk Image, displayed to the left of the label. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| values | The list of values associated with the item. |
|
||||
| | |
|
||||
| | Each item should have the same number of values as the widget |
|
||||
| | option columns. If there are fewer values than columns, the |
|
||||
| | remaining values are assumed empty. If there are more values |
|
||||
| | than columns, the extra values are ignored. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| open | ``True``/``False`` value indicating whether the item's |
|
||||
| | children should be displayed or hidden. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| tags | A list of tags associated with this item. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
+--------+---------------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+========+===============================================================+
|
||||
| text | The textual label to display for the item. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| image | A Tk Image, displayed to the left of the label. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| values | The list of values associated with the item. |
|
||||
| | |
|
||||
| | Each item should have the same number of values as the widget |
|
||||
| | option columns. If there are fewer values than columns, the |
|
||||
| | remaining values are assumed empty. If there are more values |
|
||||
| | than columns, the extra values are ignored. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| open | ``True``/``False`` value indicating whether the item's |
|
||||
| | children should be displayed or hidden. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
| tags | A list of tags associated with this item. |
|
||||
+--------+---------------------------------------------------------------+
|
||||
|
||||
|
||||
Tag Options
|
||||
|
@ -881,20 +881,20 @@ Tag Options
|
|||
|
||||
The following options may be specified on tags:
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+------------+-----------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+============+===========================================================+
|
||||
| foreground | Specifies the text foreground color. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
| background | Specifies the cell or item background color. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
| font | Specifies the font to use when drawing text. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
| image | Specifies the item image, in case the item's image option |
|
||||
| | is empty. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
+------------+-----------------------------------------------------------+
|
||||
| Option | Description |
|
||||
+============+===========================================================+
|
||||
| foreground | Specifies the text foreground color. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
| background | Specifies the cell or item background color. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
| font | Specifies the font to use when drawing text. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
| image | Specifies the item image, in case the item's image option |
|
||||
| | is empty. |
|
||||
+------------+-----------------------------------------------------------+
|
||||
|
||||
|
||||
Column Identifiers
|
||||
|
@ -926,19 +926,19 @@ Virtual Events
|
|||
|
||||
The Treeview widget generates the following virtual events.
|
||||
|
||||
.. tabularcolumns:: |l|L|
|
||||
.. tabularcolumns:: |l|L|
|
||||
|
||||
+--------------------+--------------------------------------------------+
|
||||
| Event | Description |
|
||||
+====================+==================================================+
|
||||
| <<TreeviewSelect>> | Generated whenever the selection changes. |
|
||||
+--------------------+--------------------------------------------------+
|
||||
| <<TreeviewOpen>> | Generated just before settings the focus item to |
|
||||
| | open=True. |
|
||||
+--------------------+--------------------------------------------------+
|
||||
| <<TreeviewClose>> | Generated just after setting the focus item to |
|
||||
| | open=False. |
|
||||
+--------------------+--------------------------------------------------+
|
||||
+--------------------+--------------------------------------------------+
|
||||
| Event | Description |
|
||||
+====================+==================================================+
|
||||
| <<TreeviewSelect>> | Generated whenever the selection changes. |
|
||||
+--------------------+--------------------------------------------------+
|
||||
| <<TreeviewOpen>> | Generated just before settings the focus item to |
|
||||
| | open=True. |
|
||||
+--------------------+--------------------------------------------------+
|
||||
| <<TreeviewClose>> | Generated just after setting the focus item to |
|
||||
| | open=False. |
|
||||
+--------------------+--------------------------------------------------+
|
||||
|
||||
The :meth:`Treeview.focus` and :meth:`Treeview.selection` methods can be used
|
||||
to determine the affected item or items.
|
||||
|
@ -986,19 +986,19 @@ ttk.Treeview
|
|||
|
||||
The valid options/values are:
|
||||
|
||||
* id
|
||||
id
|
||||
Returns the column name. This is a read-only option.
|
||||
* anchor: One of the standard Tk anchor values.
|
||||
anchor: One of the standard Tk anchor values.
|
||||
Specifies how the text in this column should be aligned with respect
|
||||
to the cell.
|
||||
* minwidth: width
|
||||
minwidth: width
|
||||
The minimum width of the column in pixels. The treeview widget will
|
||||
not make the column any smaller than specified by this option when
|
||||
the widget is resized or the user drags a column.
|
||||
* stretch: ``True``/``False``
|
||||
stretch: ``True``/``False``
|
||||
Specifies whether the column's width should be adjusted when
|
||||
the widget is resized.
|
||||
* width: width
|
||||
width: width
|
||||
The width of the column in pixels.
|
||||
|
||||
To configure the tree column, call this with column = "#0"
|
||||
|
@ -1041,14 +1041,14 @@ ttk.Treeview
|
|||
|
||||
The valid options/values are:
|
||||
|
||||
* text: text
|
||||
text: text
|
||||
The text to display in the column heading.
|
||||
* image: imageName
|
||||
image: imageName
|
||||
Specifies an image to display to the right of the column heading.
|
||||
* anchor: anchor
|
||||
anchor: anchor
|
||||
Specifies how the heading text should be aligned. One of the standard
|
||||
Tk anchor values.
|
||||
* command: callback
|
||||
command: callback
|
||||
A callback to be invoked when the heading label is pressed.
|
||||
|
||||
To configure the tree column heading, call this with column = "#0".
|
||||
|
@ -1398,23 +1398,23 @@ option. If you don't know the class name of a widget, use the method
|
|||
by statespec/value pairs (this is the imagespec), and *kw* may have the
|
||||
following options:
|
||||
|
||||
* border=padding
|
||||
border=padding
|
||||
padding is a list of up to four integers, specifying the left, top,
|
||||
right, and bottom borders, respectively.
|
||||
|
||||
* height=height
|
||||
height=height
|
||||
Specifies a minimum height for the element. If less than zero, the
|
||||
base image's height is used as a default.
|
||||
|
||||
* padding=padding
|
||||
padding=padding
|
||||
Specifies the element's interior padding. Defaults to border's value
|
||||
if not specified.
|
||||
|
||||
* sticky=spec
|
||||
sticky=spec
|
||||
Specifies how the image is placed within the final parcel. spec
|
||||
contains zero or more characters "n", "s", "w", or "e".
|
||||
|
||||
* width=width
|
||||
width=width
|
||||
Specifies a minimum width for the element. If less than zero, the
|
||||
base image's width is used as a default.
|
||||
|
||||
|
@ -1504,20 +1504,20 @@ uses a simplified version of the pack geometry manager: given an
|
|||
initial cavity, each element is allocated a parcel. Valid
|
||||
options/values are:
|
||||
|
||||
* side: whichside
|
||||
side: whichside
|
||||
Specifies which side of the cavity to place the element; one of
|
||||
top, right, bottom or left. If omitted, the element occupies the
|
||||
entire cavity.
|
||||
|
||||
* sticky: nswe
|
||||
sticky: nswe
|
||||
Specifies where the element is placed inside its allocated parcel.
|
||||
|
||||
* unit: 0 or 1
|
||||
unit: 0 or 1
|
||||
If set to 1, causes the element and all of its descendants to be treated as
|
||||
a single element for the purposes of :meth:`Widget.identify` et al. It's
|
||||
used for things like scrollbar thumbs with grips.
|
||||
|
||||
* children: [sublayout... ]
|
||||
children: [sublayout... ]
|
||||
Specifies a list of elements to place inside the element. Each
|
||||
element is a tuple (or other sequence type) where the first item is
|
||||
the layout name, and the other is a `Layout`_.
|
||||
|
|
|
@ -813,7 +813,7 @@ This applies to :meth:`~Mock.assert_called_with`,
|
|||
:meth:`~Mock.assert_any_call`. When :ref:`auto-speccing`, it will also
|
||||
apply to method calls on the mock object.
|
||||
|
||||
.. versionchanged:: 3.4
|
||||
.. versionchanged:: 3.4
|
||||
Added signature introspection on specced and autospecced mock objects.
|
||||
|
||||
|
||||
|
|
|
@ -1536,7 +1536,7 @@ some point in the future.
|
|||
:mod:`urllib.request` Restrictions
|
||||
----------------------------------
|
||||
|
||||
.. index::
|
||||
.. index::
|
||||
pair: HTTP; protocol
|
||||
pair: FTP; protocol
|
||||
|
||||
|
|
Loading…
Reference in New Issue