Docs: Update basalt.removeFrame.md
This commit is contained in:
@@ -1,17 +1,36 @@
|
||||
## basalt.removeFrame
|
||||
Removes the base frame by it's id. This only works for base-frames.
|
||||
|
||||
#### Parameters:
|
||||
1. `string` id
|
||||
# basalt.removeFrame
|
||||
|
||||
Removes the base frame by it's id. **This only works for base-frames.**
|
||||
|
||||
## Parameters
|
||||
|
||||
1. `string` id - ID of the base-frame.
|
||||
|
||||
## Usage
|
||||
|
||||
* Removes the previously created frame with id "secondBaseFrame"
|
||||
The frame id is gotten from a frame variable's `:getName()`
|
||||
|
||||
#### Usage:
|
||||
* Removes the previously created frame with id "myFirstFrame"
|
||||
```lua
|
||||
local main = basalt.createFrame("firstBaseFrame")
|
||||
local main2 = basalt.createFrame("secondBaseFrame")
|
||||
main:addButton()
|
||||
:setText("Remove")
|
||||
:onClick(function()
|
||||
basalt.removeFrame(main2:getName()) -- you can use main2:getName() to find out the id or just use "secondBaseFrame"
|
||||
basalt.removeFrame(main2:getName())
|
||||
end)
|
||||
```
|
||||
```
|
||||
|
||||
* Removes the previously created frame with id "secondBaseFrame", without frame stored in variable
|
||||
The frame id is the frame's name
|
||||
|
||||
```lua
|
||||
local main = basalt.createFrame("firstBaseFrame")
|
||||
local main2 = basalt.createFrame("secondBaseFrame")
|
||||
main:addButton()
|
||||
:setText("Remove")
|
||||
:onClick(function()
|
||||
basalt.removeFrame("secondBaseFrame")
|
||||
end)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user