function OnStart() { lay = app.CreateLayout( "Linear", "VCenter,FillXY" ); spin = app.CreateSpinner( "Bilbo,Frodo,Gandalf", 0.4 ); spin.SetOnChange( ShowSelection ); //spin.SelectItem( "Frodo" ); Dont write it here! lay.AddChild( spin ); app.AddLayout( lay ); //Select the Item after app.AddLayout or //it will not work right! spin.SelectItem( "Frodo" ); } function ShowSelection( item ) { app.ShowPopup( "Selected = " + item ); }