WsStaticText:
Filter:
WsGUI/Classes (extension) | GUI > WsGUI | Extensions

WsStaticText
ExtensionExtension

A WsGUI widget displaying non-editable text.

Description

A WsGUI widget displaying non-editable text.

Class Methods

.new

Create new instance and add it to the window immediately.

.init

Create new instance without adding it to the window. Use this when using WsLayout.

Arguments:

wsWindow

An instance of WsWindow

bounds

A Rect specifying the size of the widget.

NOTE: Currently a relative measurement is used: 1 for full window width, 1 for full window height, e.g. Rect(0, 0, 1, 1) would occupy whole window.

Returns:

an instance of the widget

Instance Methods

.action

Arguments:

function

A function to be performed when the widget is interacted with. Function is being passed current instance.

Returns:

Current function.

.background

Arguments:

color

Background color of the widget. Should be an instance of a Color.

NOTE: Background is transparent by default, but setting transparency is not currently supported; once the color is set, there's no way to revert back to transparency.

Returns:

current color

.stringColor

Arguments:

color

Text color of the widget. Should be an instance of a Color.

Returns:

current color

.string

Get/set a text content for applicable widgets.

Arguments:

thisString

A string to be set.

Returns:

current string

.align

Change alignment of the text.

Arguments:

align

Can be \left, \right, \center, \justify.

Returns:

Current alignment.

.font

Change the font of the text for applicable widgets.

Arguments:

font

An instance of Font. Size and font face are supported.

Returns:

Current font.

.addToPage

Add to window/page specified in *init.

.remove

Removes the widget from the window.

Examples