Skip to content

Commit b88f737

Browse files
bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)
(cherry picked from commit 4b685bf) Co-authored-by: Andrés Delfino <34587441+andresdelfino@users.noreply.github.com>
1 parent 3b3be1f commit b88f737

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Doc/library/tkinter.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,12 +783,13 @@ Menu indexes (menu.invoke(), menu.entryconfig(), etc.)
783783
Images
784784
^^^^^^
785785

786-
Bitmap/Pixelmap images can be created through the subclasses of
787-
:class:`tkinter.Image`:
786+
Images of different formats can be created through the corresponding subclass
787+
of :class:`tkinter.Image`:
788788

789-
* :class:`BitmapImage` can be used for X11 bitmap data.
789+
* :class:`BitmapImage` for images in XBM format.
790790

791-
* :class:`PhotoImage` can be used for GIF and PPM/PGM color bitmaps.
791+
* :class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter
792+
is supported starting with Tk 8.6.
792793

793794
Either type of image is created through either the ``file`` or the ``data``
794795
option (other options are available as well).

Lib/tkinter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,7 +3533,7 @@ def width(self):
35333533
self.tk.call('image', 'width', self.name))
35343534

35353535
class PhotoImage(Image):
3536-
"""Widget which can display colored images in GIF, PPM/PGM format."""
3536+
"""Widget which can display images in PGM, PPM, GIF, PNG format."""
35373537
def __init__(self, name=None, cnf={}, master=None, **kw):
35383538
"""Create an image with NAME.
35393539
@@ -3597,7 +3597,7 @@ def write(self, filename, format=None, from_coords=None):
35973597
self.tk.call(args)
35983598

35993599
class BitmapImage(Image):
3600-
"""Widget which can display a bitmap."""
3600+
"""Widget which can display images in XBM format."""
36013601
def __init__(self, name=None, cnf={}, master=None, **kw):
36023602
"""Create a bitmap with NAME.
36033603

0 commit comments

Comments
 (0)