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

WsInput
ExtensionExtension

A text input field for WsGUI

Description

A text input field for WsGUI

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

Gets or sets function to be evaluated when the button is pressed.

Arguments:

function

Any object to set as default action, usually a Function. It is passed the current instance.

.background

Arguments:

color

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

Returns:

current color

.value

Sets the current contents of the input box. Does not trigger the action.

Arguments:

val

A String to set.

.valueAction

Sets the current contents of the input box.

Arguments:

val

A String to set.

.stringColor

Arguments:

color

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

Returns:

current color

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

Examples