Py5Surface.set_icon()#

Set the Sketch window icon.

Examples#

1def setup():
2    surface = py5.get_surface()
3    surface.set_title("py5 window")
4    surface.set_always_on_top(True)
5    surface.set_icon(py5.load_image("logo-64x64.png"))
 1def settings():
 2    py5.size(200, 200, py5.P2D)
 3    PJOGL = py5.JClass("processing.opengl.PJOGL")
 4    PJOGL.setIcon("data/logo-64x64.png")
 5
 6
 7def setup():
 8    surface = py5.get_surface()
 9    surface.set_title("py5 window")
10    surface.set_always_on_top(True)
11
12
13py5.run_sketch(block=False)

Description#

Set the Sketch window icon. This will typically appear in the window’s title bar. The default window icon is the same as Processing’s.

This method will not work for the P2D or P3D renderers. Setting the icon for those renderers is a bit tricky; the icon must be a PNG file and it must be done in settings(). See the second example to learn how to do that.

Underlying Processing method: PSurface.setIcon

Syntax#

set_icon(icon: Py5Image, /) -> None

Parameters#

  • icon: Py5Image - image to use as the window icon

Updated on November 12, 2021 11:30:58am UTC