The problem I'm seeing is that the first item selected doesn't trigger the OnChange function. If you select something in the spinner a second time, it works no problem. Tried with OnTouch too, but got the same result.
So, is this a bug, or am I experiencing an id10t error? Maybe it's a pebcak error? I know both are easy to miss.
Thanks!
P.S. If you look at this code, you'll learn a secret about me.
The normal workaround is to add a first item to the list "Please select a captain"
Thank you again, looking forward to your responce.
Thanks.
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
spin = app.CreateSpinner("Please select a captain, Kirk, Picard, Janeway", 0.4 );
spin.SetOnChange( ShowSelection );
spin.SelectItem( "Picard" );
spin.SetOnTouch(touch);
lay.AddChild( spin );
app.AddLayout( lay );
} //onStart
function ShowSelection( item ) {
alert( "Selected = " + item );
}
function touch( item ) {
alert( "Touched, Selected = " + item );
}