[Python-checkins] bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) (GH-6542)
Serhiy Storchaka
webhook-mailer at python.org
Fri Apr 20 02:15:04 EDT 2018
https://github.com/python/cpython/commit/7a45eb9efb6fffdb4051d1f62b3af4f50c083bf1
commit: 7a45eb9efb6fffdb4051d1f62b3af4f50c083bf1
branch: 2.7
author: Andrés Delfino <34587441+andresdelfino at users.noreply.github.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2018-04-20T09:15:01+03:00
summary:
bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) (GH-6542)
(cherry picked from commit 4b685bf7192fff48c8effeeae4f4d64f9420ec0f)
Update only the documentation about image formats.
files:
M Doc/library/tkinter.rst
M Lib/lib-tk/Tkinter.py
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index ce5e63a717b3..7d80b40fdf52 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -801,12 +801,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/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 6198c4c94921..b226fd5f3529 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -3362,7 +3362,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.
@@ -3426,7 +3426,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