Canvas Toolkit
← Class index

CIcon

GUI and styling

Stores pixmaps used to represent an icon in different modes and states.

import { CIcon } from "canvas-toolkit-lib";

Declared members

constructor(pixmap?: CPixmap | null);

Creates a new CIcon instance. @param pixmap Pixmap.

isNull(): boolean;

Returns whether the icon contains no pixmaps. @returns The resulting value.

addPixmap(pixmap: CPixmap, mode?: CIconMode, state?: CIconState): void;

Adds a pixmap for the specified icon mode and state. @param pixmap Pixmap. @param mode Mode. @param state State.

pixmap(size: CSize, mode?: CIconMode, state?: CIconState): CPixmap | null;

Returns the best matching pixmap for the requested size, mode, and state. @param size Size. @param mode Mode. @param state State. @returns The resulting value.

availableSizes(mode?: CIconMode, state?: CIconState): CSize[];

Returns the sizes available for the specified icon mode and state. @param mode Mode. @param state State. @returns The resulting value.