docs updates

This commit is contained in:
Robert Jelic
2022-09-06 17:43:03 +02:00
parent 4d227af9d9
commit 51f6ebe7ce
15 changed files with 630 additions and 22 deletions

View File

@@ -1,8 +1,5 @@
## removeFocusedObject
Removes the focus of the supplied object
#### Parameters:
1. `object` The child object to remove focus from
Removes the currently focused object of that frame
#### Returns:
1. `frame` The frame being used
@@ -10,7 +7,9 @@ Removes the focus of the supplied object
#### Usage:
* Creates a new button then removes the focus from that button when clicking on it
```lua
local aButton = myFrame:addButton():setFocus():onClick(function()
myFrame:removeFocusedObject(aButton)
local main = basalt.createFrame()
local input = main:addInput():setFocus()
local aButton = main:addButton():onClick(function()
main:removeFocusedObject()
end)
```

View File

@@ -2,7 +2,7 @@
Removes a child object from the frame
#### Parameters:
1. `string` The name of the child object
1. `string|object` The name of the child object or the object itself
#### Returns:
1. `boolean` Whether the object with the given name was properly removed
@@ -10,6 +10,9 @@ Removes a child object from the frame
#### Usage:
* Adds a button with the id "myFirstButton", then removes it with the aforementioned id
```lua
myFrame:addButton("myFirstButton")
myFrame:removeObject("myFirstButton")
local main = basalt.createFrame()
main:addButton("myFirstButton"):setText("Close")
:onClick(function(self)
main:removeObject("myFirstButton") -- or main:removeObject(self)
end)
```