The problem with CreateSeekBar and SetValue command for this

25 views
Skip to first unread message

DogPlanner GSS

unread,
Dec 10, 2025, 4:49:32 AM (4 days ago) Dec 10
to DroidScript
Dear developers,

Below is my program with SeekBar creation. After SetValue(50) performing the SeekBar is set to the 100% position:

    scd_product_slider = app.CreateSeekBar(0.8);
    scd_product_slider.SetRange(0, 100); // Set the range of the SeekBar (e.g., 0 to 100)
    scd_product_slider.SetValue(50); // Set an initial value

    app.ShowPopup("Slider value: " + scd_product_slider.GetValue());

And when performing GetValue command the Value = 0.

Could you tell pls are we doing something wrong or it is DS problem?

Thank you very much in advance. Have a nice day.

Alan Hendry

unread,
Dec 10, 2025, 1:29:48 PM (4 days ago) Dec 10
to DroidScript
HI,
I think SetRange only needs one parm
Regards, Alan H
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 );
    alert(skb.GetValue())
}

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

DogPlanner GSS

unread,
Dec 11, 2025, 5:35:40 AM (3 days ago) Dec 11
to DroidScript
Dear Alan,

thank you very much for this information! It works! Now we could move on with our app making :)

Have a nice day!

Best regards
Dmitry

среда, 10 декабря 2025 г. в 21:29:48 UTC+3, hendr...@gmail.com:
Reply all
Reply to author
Forward
0 new messages