Canvas Toolkit
← Class index

CBoxLayoutItem

Layouts · extends CWidgetItem

Layout item used by box layouts, with an associated stretch factor.

Module layouts/CBoxLayoutItem.js. This class is available through the browser modules in the download.

Declared members

constructor(widget: CWidget | null, stretch?: number);

Creates a box-layout item. @param widget Widget represented by the item, or `null` for a stretch. @param stretch Non-negative stretch factor.

stretch(): number;

Returns the item's stretch factor.

setStretch(stretch: number): void;

Sets the item's stretch factor. Negative values are clamped to zero.