[Python-checkins] bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)

Miss Islington (bot) webhook-mailer at python.org
Tue Apr 17 06:10:48 EDT 2018


https://github.com/python/cpython/commit/f44ce356a6ccd6c8e80ac5c4b29adb13db5c117a
commit: f44ce356a6ccd6c8e80ac5c4b29adb13db5c117a
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-04-17T03:10:39-07:00
summary:

bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)

(cherry picked from commit 4b685bf7192fff48c8effeeae4f4d64f9420ec0f)

Co-authored-by: Andrés Delfino <34587441+andresdelfino at users.noreply.github.com>

files:
M Doc/library/tkinter.rst
M Lib/tkinter/__init__.py

diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index f51add2b41fe..d6e33ebde0ff 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -783,12 +783,13 @@ Menu indexes (menu.invoke(), menu.entryconfig(), etc.)
 Images
 ^^^^^^
 
-Bitmap/Pixelmap images can be created through the subclasses of
-:class:`tkinter.Image`:
+Images of different formats can be created through the corresponding subclass
+of :class:`tkinter.Image`:
 
-* :class:`BitmapImage` can be used for X11 bitmap data.
+* :class:`BitmapImage` for images in XBM format.
 
-* :class:`PhotoImage` can be used for GIF and PPM/PGM color bitmaps.
+* :class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter
+  is supported starting with Tk 8.6.
 
 Either type of image is created through either the ``file`` or the ``data``
 option (other options are available as well).
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 53bad3fa95ae..b78191e2777f 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -3533,7 +3533,7 @@ def width(self):
             self.tk.call('image', 'width', self.name))
 
 class PhotoImage(Image):
-    """Widget which can display colored images in GIF, PPM/PGM format."""
+    """Widget which can display images in PGM, PPM, GIF, PNG format."""
     def __init__(self, name=None, cnf={}, master=None, **kw):
         """Create an image with NAME.
 
@@ -3597,7 +3597,7 @@ def write(self, filename, format=None, from_coords=None):
         self.tk.call(args)
 
 class BitmapImage(Image):
-    """Widget which can display a bitmap."""
+    """Widget which can display images in XBM format."""
     def __init__(self, name=None, cnf={}, master=None, **kw):
         """Create a bitmap with NAME.
 



More information about the Python-checkins mailing list