Skip to content

Commit 7a45eb9

Browse files
andresdelfinoserhiy-storchaka
authored andcommitted
bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) (GH-6542)
(cherry picked from commit 4b685bf) Update only the documentation about image formats.
1 parent d988c0b commit 7a45eb9

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
@@ -801,12 +801,13 @@ Menu indexes (menu.invoke(), menu.entryconfig(), etc.)
801801
Images
802802
^^^^^^
803803

804-
Bitmap/Pixelmap images can be created through the subclasses of
805-
:class:`Tkinter.Image`:
804+
Images of different formats can be created through the corresponding subclass
805+
of :class:`Tkinter.Image`:
806806

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

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

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

Lib/lib-tk/Tkinter.py

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

33643364
class PhotoImage(Image):
3365-
"""Widget which can display colored images in GIF, PPM/PGM format."""
3365+
"""Widget which can display images in PGM, PPM, GIF, PNG format."""
33663366
def __init__(self, name=None, cnf={}, master=None, **kw):
33673367
"""Create an image with NAME.
33683368
@@ -3426,7 +3426,7 @@ def write(self, filename, format=None, from_coords=None):
34263426
self.tk.call(args)
34273427

34283428
class BitmapImage(Image):
3429-
"""Widget which can display a bitmap."""
3429+
"""Widget which can display images in XBM format."""
34303430
def __init__(self, name=None, cnf={}, master=None, **kw):
34313431
"""Create a bitmap with NAME.
34323432

0 commit comments

Comments
 (0)