• Home
  • Raw
  • Download

Lines Matching refs:Tk

1 :mod:`tkinter` --- Python interface to Tcl/Tk
5 :synopsis: Interface to Tcl/Tk for graphical user interfaces
13 The :mod:`tkinter` package ("Tk interface") is the standard Python interface to
14 the Tcl/Tk GUI toolkit. Both Tk and :mod:`tkinter` are available on most Unix
18 demonstrating a simple Tk interface, letting you know that :mod:`tkinter` is
19 properly installed on your system, and also showing what version of Tcl/Tk is
20 installed, so you can read the Tcl/Tk documentation specific to that version.
22 Tkinter supports a range of Tcl/Tk versions, built either with or
23 without thread support. The official Python binary release bundles Tcl/Tk 8.6
29 additions and changes, and refer to the official Tcl/Tk documentation for
34 Tcl/Tk 8.5 (2007) introduced a modern set of themed user interface components
48 Tcl/Tk Resources:
50 * `Tk commands <https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm>`_
51 Comprehensive reference to each of the underlying Tcl/Tk commands used by Tkinter.
53 * `Tcl/Tk Home Page <https://www.tcl.tk>`_
54 Additional documentation, and links to Tcl/Tk core development.
67 * `Tcl and the Tk Toolkit (2nd edition) <https://www.amazon.com/exec/obidos/ASIN/032133633X>`_
68 …By John Ousterhout, inventor of Tcl/Tk, and Ken Jones; does not cover Tkinter. (ISBN 978-032133633…
74 Tcl/Tk is not a single library but rather consists of a few distinct
83 interface to the Tk toolkit. The Tcl library has a C interface to
92 Tk
93 Tk is a `Tcl package <http://wiki.tcl.tk/37432>`_ implemented in C
95 :class:`Tk` object embeds its own Tcl interpreter instance with Tk loaded into
96 it. Tk's widgets are very customizable, though at the cost of a dated appearance.
97 Tk uses Tcl's event queue to generate and process GUI events.
100 Themed Tk (Ttk) is a newer family of Tk widgets that provide a much better
101 appearance on different platforms than many of the classic Tk widgets.
102 Ttk is distributed as part of Tk, starting with Tk version 8.5. Python
105 Internally, Tk and Ttk use facilities of the underlying operating system,
109 the :mod:`tkinter` module first assembles a Tcl/Tk command string. It passes that
112 Tk and/or Ttk packages, which will in turn make calls to Xlib, Cocoa, or GDI.
127 .. class:: Tk(screenName=None, baseName=None, className='Tk', useTk=1)
129 The :class:`Tk` class is instantiated without arguments. This creates a toplevel
130 widget of Tk which usually is the main window of an application. Each instance
136 .. function:: Tcl(screenName=None, baseName=None, className='Tk', useTk=0)
139 that created by the :class:`Tk` class, except that it does not initialize the Tk
143 created by the :func:`Tcl` object can have a Toplevel window created (and the Tk
147 The modules that provide Tk support include:
165 Access to standard Tk dialog boxes.
174 Themed widget set introduced in Tk 8.5, providing modern alternatives
180 A binary module that contains the low-level interface to Tcl/Tk.
197 become deprecated when it is replaced with the Tk DND.
200 (deprecated) An older third-party Tcl/Tk package that adds several new
204 Turtle graphics in a Tk window.
210 This section is not designed to be an exhaustive tutorial on either Tk or
213 application looks like, identifies foundational Tk concepts, and
218 find more detailed documentation on them, including in the official Tcl/Tk
233 root = Tk()
241 After the imports, the next line creates an instance of the :class:`Tk` class,
242 which initializes Tk and creates its associated Tcl interpreter. It also
262 Important Tk Concepts
265 Even this simple program illustrates the following key Tk concepts:
294 Understanding How Tkinter Wraps Tcl/Tk
298 is assembling strings representing Tcl/Tk commands, and executing those
299 commands in the Tcl interpreter attached to your applicaton's :class:`Tk`
305 what those underlying Tcl/Tk commands look like.
307 To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter
352 across different versions of both Tkinter and Tcl/Tk. If you're searching
353 documentation, make sure it corresponds to the Python and Tcl/Tk versions
391 Navigating the Tcl/Tk Reference Manual
394 As noted, the official `Tk commands <https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm>`_
400 objects, you've seen that many Tcl/Tk operations appear as commands that
410 when you create a widget in Tcl/Tk, it creates a Tcl command with the name
420 In the official Tcl/Tk reference documentation, you'll find most operations
450 Python and Tcl/Tk have very different threading models, which :mod:`tkinter`
458 Each :class:`Tk` object created by :mod:`tkinter` contains a Tcl interpreter.
461 from a thread other than the one that created the :class:`Tk` object, an event
465 Tcl/Tk applications are normally event-driven, meaning that after initialization,
466 the interpreter runs an event loop (i.e. :func:`Tk.mainloop`) and responds to events.
480 * Tcl/Tk libraries can be built so they are not thread-aware. In this case,
485 * While :mod:`tkinter` allows you to create more than one instance of a :class:`Tk`
488 more than one instance of :class:`Tk` at a time. Otherwise, it's best to create
489 them in separate threads and ensure you're running a thread-aware Tcl/Tk build.
528 For a complete explanation of a given option and its behavior, see the Tk man
583 The packer is one of Tk's geometry-management mechanisms. Geometry managers
687 root = tk.Tk()
696 In Tk, there is a utility command, ``wm``, for interacting with the window
708 part of the implementation, and not an interface to Tk functionality.
732 Tk Option Data Types
735 .. index:: single: Tk Option Data Types
777 Tk uses a list font name format, such as ``{courier 10 bold}``. Font sizes with
848 they are denoted in Tk, which can be useful when referring to the Tk man pages.
851 | Tk | Tkinter Event Field | Tk | Tkinter Event Field |
884 The index notation for Text widgets is very rich and is best described in the Tk
921 is supported starting with Tk 8.6.
927 some widget (e.g. labels, buttons, menus). In these cases, Tk will not keep a
929 deleted, the image data is deleted as well, and Tk will display an empty box
942 Tk allows you to register and unregister a callback function which will be
943 called from the Tk mainloop when I/O is possible on a file descriptor.
947 widget = tkinter.Tk()