MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / wm_iconphoto

Method wm_iconphoto

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:2179–2202  ·  view source on GitHub ↗

Sets the titlebar icon for this window based on the named photo images passed through args. If default is True, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the time of invocation. If the images are la

(self, default=False, *args)

Source from the content-addressed store, hash-verified

2177 iconname = wm_iconname
2178
2179 def wm_iconphoto(self, default=False, *args): # new in Tk 8.5
2180 """Sets the titlebar icon for this window based on the named photo
2181 images passed through args. If default is True, this is applied to
2182 all future created toplevels as well.
2183
2184 The data in the images is taken as a snapshot at the time of
2185 invocation. If the images are later changed, this is not reflected
2186 to the titlebar icons. Multiple images are accepted to allow
2187 different images sizes to be provided. The window manager may scale
2188 provided icons to an appropriate size.
2189
2190 On Windows, the images are packed into a Windows icon structure.
2191 This will override an icon specified to wm_iconbitmap, and vice
2192 versa.
2193
2194 On X, the images are arranged into the _NET_WM_ICON X property,
2195 which most modern window managers support. An icon specified by
2196 wm_iconbitmap may exist simultaneously.
2197
2198 On Macintosh, this currently does nothing."""
2199 if default:
2200 self.tk.call('wm', 'iconphoto', self._w, "-default", *args)
2201 else:
2202 self.tk.call('wm', 'iconphoto', self._w, *args)
2203
2204 iconphoto = wm_iconphoto
2205

Callers 1

mainFunction · 0.80

Calls 1

callMethod · 0.80

Tested by

no test coverage detected