FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-13553: Document tkinter.Tk args by csabella · Pull Request #4786 · python/cpython · GitHub

/ cpython Public
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Changes suggested by Serhiy.
  • Loading branch information
csabella committed Dec 11, 2017
commit 35c64653754fc978b18024fecc9ceddb23bd8b35
21 changes: 11 additions & 10 deletions Doc/library/tkinter.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -67,36 +67,37 @@ Or, more often::
from tkinter import *


.. class:: Tk(screenName=None, baseName=None, className='Tk', useTk=1, sync=0, use=None)
.. class:: Tk(screenName=None, baseName=None, className='Tk', useTk=True, sync=False, use=None)

Return a toplevel Tk widget, which is usually the main window of an
application. Each instance has its own associated Tcl interpreter.
Toplevel Tk widget, which is usually the main window of an application.
Each instance has its own associated Tcl interpreter.

The :class:`Tk` class is typically instantiated using all default values.
However, the following keyword arguments are currently recognized:

*screenName*
Sets the DISPLAY environmental variable. (X11 only)
Sets the :envvar:`DISPLAY` environmental variable. (X11 only)
Comment thread
JulienPalard marked this conversation as resolved.
Outdated
*baseName*
Reads the profile file :file:`baseName.tcl` into the Tcl interpreter and
calls ``exec`` on the contents of :file:`baseName.py`.
Reads the profile file :file:`{baseName}.tcl` into the Tcl interpreter
Comment thread
JulienPalard marked this conversation as resolved.
Outdated
and calls :func:`exec` on the contents of :file:`{baseName}.py`.
*className*
Name of the widget class. Used as a profile file name
Comment thread
JulienPalard marked this conversation as resolved.
Outdated
(:file:`className.tcl` and :file:`className.py` load before the
(:file:`{className}.tcl` and :file:`{className}.py` load before the
*baseName* files), and also used as the name with which Tcl is
invoked (*argv0* in *interp*).
Comment thread
JulienPalard marked this conversation as resolved.
Outdated
*useTk*
If True, initialize the Tk subsystem. :func:`Tcl` sets this to False.
If ``True``, initialize the Tk subsystem. :func:`Tcl` sets this to
``False``.
*sync*
If True, execute all X server commands synchronously, so that errors are
If ``True``, execute all X server commands synchronously, so that errors are
reported immediately.
*use*
Specifies that the main window for the application is to be embedded in
the window whose identifier is given, instead of being created as an
independent toplevel window.
Comment thread
JulienPalard marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

While we are documenting the Tk class. Would it be worth it to document Tk attributes? master, children and tk.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The current page reads more like a 'getting started' or 'how to', so I wasn't sure how much detail to add. I know there's a separate bug issue where Terry figured out the difference between master and parent, so maybe it would be worthwhile to include that here?


.. function:: Tcl(screenName=None, baseName=None, className='Tk', useTk=0)
.. function:: Tcl(screenName=None, baseName=None, className='Tk', useTk=False)

The :func:`Tcl` function is a factory function which creates an object much like
that created by the :class:`Tk` class, except that it does not initialize the Tk
Expand Down

Back | FazBrowse Home | New Git URL