Back

AddDrawer

JS Py
Hello World

AddDrawer adds layout as drawer on a given side.

app.AddDrawer( layout, side, width=-1, grabWidth? )

If the user swipes from this side to the other the layout will slide out.

See Also: OpenDrawer, CloseDrawer, RemoveDrawer

Example - left

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

    txt1 = app.CreateText( "<-- swipe" );
    txt1.SetTextSize( 30 );
    lay.AddChild( txt1 );

    app.AddLayout( lay );

    layDrawer = app.CreateLayout( "Linear", "FillXY,VCenter" );
    layDrawer.SetBackground( "/Sys/Img/BlueBack.jpg" );

    txt2 = app.CreateText( "Hello" );
    txt2.SetTextSize( 40 );
    layDrawer.AddChild( txt2 );

    app.AddDrawer( layDrawer, "left", 0.8 );
}
from native import app

def OnStart():
    lay = app.CreateLayout( "Linear", "FillXY,VCenter" )

    txt1 = app.CreateText( "<-- swipe" )
    txt1.SetTextSize( 30 )
    lay.AddChild( txt1 )

    app.AddLayout( lay )

    layDrawer = app.CreateLayout( "Linear", "FillXY,VCenter" )
    layDrawer.SetBackground( "/Sys/Img/BlueBack.jpg" )

    txt2 = app.CreateText( "Hello" )
    txt2.SetTextSize( 40 )
    layDrawer.AddChild( txt2 )

    app.AddDrawer( layDrawer, "left", 0.8 )
    Copy     Copy All       Run      
Number: fraction (0..1)
String: “Left” or “Right”
app object: Layout