Docs: Basalt.stopUpdate

This commit is contained in:
Erb3
2022-09-17 14:33:04 +02:00
parent 1efca45639
commit 9acf7d5345
2 changed files with 11 additions and 6 deletions

View File

@@ -28,7 +28,7 @@ You are now able to access the following list of methods:
|[setActiveFrame](objects/Basalt/setActiveFrame.md)|Sets the active frame
|[setTheme](objects/Basalt/setTheme.md)|Changes the base theme of basalt
|[setVariable](objects/Basalt/setVariable.md)|Sets a variable which you can access via XML
|[stopUpdate](objects/Basalt/stopUpdate.md)|Stops the currently active event and draw listener
|[stopUpdate / stop](objects/Basalt/stopUpdate.md)|Stops the currently active event and draw listener
|[update](objects/Basalt/update.md)|Starts the event and draw listener once
## Examples

View File

@@ -1,15 +1,20 @@
## basalt.stopUpdate or basalt.stop
Stops the automatic draw and event handler which got started by basalt.autoUpdate()
#### Usage:
# basalt.stopUpdate or basalt.stop
Stops the automatic draw and event handler which got started by `basalt.autoUpdate()`.
`basalt.autoUpdate(false)` also does the same.
## Usage
* When the quit button is clicked, the button stops basalt's event listeners and draw handlers
```lua
local main = basalt.createFrame()
local aButton = main:addButton()
main:addButton()
:setPosition(2,2)
:setText("Stop Basalt!")
:onClick(function()
basalt.stopUpdate()
end)
basalt.autoUpdate()
```
```