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

WsWidget
ExtensionExtension

Superclass for widgets of WsGUI

Description

As a superclass for elements of WsGUI interface, this class should not be used on its own. See subclassess for details and examples.

Instance Methods

.action

Arguments:

function

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

Returns:

Current function.

.background

Arguments:

color

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

Returns:

current color

.stringColor

Arguments:

color

Text color of the widget that contains text. 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

.addToPage

Add to window/page specified in *init (see subclass help).

.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.

.remove

Removes the widget from the window.

Examples