Icon
class in package klyn.gui.windows

    public class Icon:

Icon

Reusable image descriptor for GUI controls.

The concrete image is resolved once when the icon is created. Reusing it avoids allocating and identifying an image on every repaint, which is particularly important for SVG icons in toolbars and dock bars.

    saveIcon = Icon("assets/icons/save.svg")
    saveButton.icon = saveIcon

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | filename `filename as String:` | Source filename resolved by this icon.
public readonly property | image `image as Image:` | Concrete image reused while painting controls.

Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | Icon `Icon(filename as String = ""):` | Creates an icon from an SVG or raster image file.