Back

SeekBars

Create SeekBars using the CreateSeekBar method of the app object:

 skb = app.CreateSeekBar( width, height );

The SetRange method of the SeekBar object to sets the value range of the SeekBar and the SetValue method sets the current value.

Use the SetOnTouch method of the SeekBar object to set the name of a function you want to be called when the SeekBar is touched. You can read the 'value' parameter in your callback function to get the position value of the SeekBar

Example

function OnStart()
{
    lay = app.CreateLayout( "Linear", "VCenter,FillXY" );

    skb = app.CreateSeekBar( 0.8 );
    skb.SetRange( 1.0 );
    skb.SetValue( 0.5 );
    skb.SetOnTouch( skb_OnTouch );
    lay.AddChild( skb );

    app.AddLayout( lay );
}

function skb_OnTouch( value )
{
    app.ShowPopup( "Value = " + value );
}
    Copy     Copy All      Run     

See 'CreateSeekBar for more informations and a complete function list