Basalt 1.7 Update
- New Objects (Flexbox, Graph, Treeview) - Pluginsystem to add/remove functionality - Reworked the entire Object system, instead of one big Object Class we have multiple classes: Object, VisualObject, ChangeableObject - Instead of one big Frame Class we have multiple Frame Classes: BaseFrame, Frame, MovableFrame, ScrollableFrame, MonitorFrame, Flexbox - Removed the Animation Object, and added a animation plugin instead - Removed the Graphic Object and merged it's functionality with the image object - Updated currently existing objects
This commit is contained in:
37
docs/objects/Container/removeObject.md
Normal file
37
docs/objects/Container/removeObject.md
Normal file
@@ -0,0 +1,37 @@
|
||||
## removeObject
|
||||
|
||||
### Description
|
||||
|
||||
Removes an object from the container by its ID. If the object is not a direct child of the container, this method will not remove it.
|
||||
|
||||
### Parameters
|
||||
|
||||
1. `string` id - The ID of the object you want to retrieve.
|
||||
|
||||
### Returns
|
||||
|
||||
1. `boolean` true if the object was removed
|
||||
|
||||
### Usage
|
||||
|
||||
```lua
|
||||
local main = basalt.createFrame()
|
||||
local container = main:addFrame("container")
|
||||
local button = container:addButton("removableButton")
|
||||
:setPosition(2, 2)
|
||||
:setText("Remove me")
|
||||
|
||||
main:addButton()
|
||||
:setPosition(2, 4)
|
||||
:setText("Remove the button above")
|
||||
:onClick(function()
|
||||
local removed = container:removeObject("removableButton")
|
||||
if removed then
|
||||
basalt.debug("Button removed!")
|
||||
else
|
||||
basalt.debug("Button not found!")
|
||||
end
|
||||
end)
|
||||
|
||||
basalt.autoUpdate()
|
||||
```
|
||||
Reference in New Issue
Block a user