Back

DisableTouch

JS Py
Hello World

Use this method to prevent any user interaction with the app.

app.DisableTouch( disable )

You could use this for a safe mode for a slideshow.

Example - Demo

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

    btn = app.CreateButton( "Disable", 0.3, 0.1 );
    btn.SetOnTouch( btn_OnTouch );
    lay.AddChild( btn );

    app.AddLayout( lay );
}

function btn_OnTouch()
{
    app.DisableTouch( true );
    app.ShowPopup( "Touch Disabled." );
}
from native import app

<!--[CDATA[
def OnStart():
    lay = app.CreateLayout( "linear", "VCenter,FillXY,touchspy" )

    btn = app.CreateButton( "Disable", 0.3, 0.1 )
    btn.SetOnTouch( btn_OnTouch )
    lay.AddChild( btn )

    app.AddLayout( lay )

def btn_OnTouch():
    app.DisableTouch( True )
    app.ShowPopup( "Touch Disabled." )
]]>
    Copy     Copy All       Run      
Boolean