Skip to content

Commit e68e136

Browse files
committed
1 parent 02f712e commit e68e136

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Doc/library/tkinter.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,45 @@ added and changed logic and refer to the official Tcl/Tk documentation for
3030
details that are unchanged.
3131

3232

33+
Architecture
34+
------------
35+
36+
Unlike most other GUI toolkits, Tcl/Tk is not a monolithic product providing a
37+
consolidated API. Instead, it's a bundle of libraries, each with its
38+
separate functionality and documentation.
39+
40+
Tcl
41+
Tcl is a dynamic interpreted programming language. Though it can be used
42+
as a general-purpose programming language, it's primary developed to be and
43+
used as an embedded scripting engine for applications (same as Lua) and as
44+
an interface to the Tk toolkit. The Tcl engine library has a C interface to
45+
create and operate interpreter instances, run Tcl commands and scripts with
46+
them and add custom commands that can be implemented in either Tcl or C.
47+
It also implements a per-interpreter event queue. An interpreter
48+
instance has a single stream of execution. Each :class:`Tk` object embeds
49+
its own interpreter instance. Though :mod:`_tkinter` allows to
50+
execute entire Tcl scripts, the Python bindings typically only invoke single
51+
commands.
52+
53+
Tk
54+
Tk is a Tcl module implemented in C that adds custom commands to create and
55+
manipulate GUI widgets. The interpreter's event queue is used to generate
56+
and process events for all widgets created by it.
57+
Tcl can be used without Tk (and Tk needs to be explicitly loaded to make it
58+
available; :mod:`tkinter` does this automatically), though they are
59+
typically provided together, "Tcl/Tk" being the name for the bundle.
60+
Tk also implements the Themed Tk (Ttk) family of widgets, though `tkinter`
61+
provides Python bindings for them in a separate module, :mod:`tkinter.ttk`.
62+
Tk has its own C interface that duplicates the custom Tcl commands though
63+
`tkinter` mostly uses the latter.
64+
65+
Tix
66+
`Tix`<https://core.tcl.tk/jenglish/gutter/packages/tix.html> is a
67+
third-party Tcl module, an addon for Tk that adds several new widgets.
68+
`tkinter.tix` provides bindings for it, and official Python binary releases
69+
come with it bundled. It's deprecated in favor of Ttk.
70+
71+
3372
Tkinter Modules
3473
---------------
3574

0 commit comments

Comments
 (0)