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

gh-153256: Add tk_print() methods to tkinter Canvas and Text by serhiy-storchaka · Pull Request #153257 · python/cpython · GitHub

Repository navigation

gh-153256: Add tk_print() methods to tkinter Canvas and Text - #153257

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-tk-print
Jul 11, 2026
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-tk-print

Conversation

serhiy-storchaka commented Jul 7, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Add a tk_print() method to tkinter.Canvas and tkinter.Text wrapping the tk print command (Tk 8.7/9.0 and newer), which opens the native platform print dialog to print the contents of the widget.

Since tk print only supports canvas and text widgets, the method is added to those two classes rather than to the common Misc base class.

Calling the method opens the native print dialog, so it cannot be exercised in the test suite; the test only checks that the method is present on Canvas and Text and absent elsewhere.

The native print dialog (the "tk print" command, Tk 8.7/9.0+) only
supports canvas and text widgets, so expose it as a method of Canvas
and Text rather than of Misc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

read-the-docs-community Bot commented Jul 7, 2026 •
edited
Loading

Copy link
Copy Markdown

serhiy-storchaka enabled auto-merge (squash) July 11, 2026 04:39
serhiy-storchaka merged commit 45fa07b into python:main Jul 11, 2026
51 checks passed
serhiy-storchaka deleted the tkinter-tk-print branch July 11, 2026 06:01
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL