1 2-- Register all Toolbar actions and intialize all UI stuff 3function initUi() 4 app.registerUi({["menu"] = "Toggle Grid Paper", ["callback"] = "toggleGridPaper"}); 5end 6 7local toggleState = false 8 9function toggleGridPaper() 10 if toggleState == true then 11 app.uiActionSelected("GROUP_GRID_SNAPPING", "ACTION_GRID_SNAPPING"); 12 app.changeCurrentPageBackground("graph"); 13 else 14 app.uiActionSelected("GROUP_GRID_SNAPPING", "ACTION_NONE"); 15 app.changeCurrentPageBackground("plain"); 16 end 17 toggleState = not toggleState 18end