Tab-Select

(Sample Code taken from the DroidScript Google-Group)

tab_select.js
function OnStart()
{
    //Create a layout with objects vertically centered.
    lay = app.CreateLayout( "linear", "VCenter,FillXY" );    
 
    //Create tabs.
    tabs = app.CreateTabs( "FRED,BILL,MARK", 0.8, 0.8, "VCenter" );
    tabs.SetOnChange( tabs_OnChange ); 
    lay.AddChild( tabs ); 
 
    //Add button to first tab.
    layFred = tabs.GetLayout( "FRED" );
    btn = app.CreateButton( "Choose Mark" );
    btn.SetOnTouch(btnOnTouch);
    layFred.AddChild( btn );
 
    //Add button to second tab.
    layBill = tabs.GetLayout( "BILL" );
    chk = app.CreateCheckBox( "CheckBox" );
    layBill.AddChild( chk );
 
    //Add layout to app.    
    app.AddLayout( lay );
}
 
//Handle tab selection.
function tabs_OnChange( name )
{
    app.ShowPopup( name );
}
 
function btnOnTouch()
{
    tabs.ShowTab("MARK")
}