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

WsSlider
ExtensionExtension

A slider for WsGUI

Description

A slider 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 slider is pressed/moved.

Arguments:

function

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

.value

Sets the current state. Does not trigger the action.

Arguments:

val

A float setting the state number.

.valueAction

Sets the current state and triggers the action.

Arguments:

val

A float setting the state number.

.background

Arguments:

color

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

Returns:

current color

Examples