mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-16 08:04:21 +08:00
Allows components to remove a child or access to children in general (#152)
Allows components to remove a child or access to children in general. Co-authored-by: Felix Heitmann <fheitmann@se-gpu-03.intern.plath.de> Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
@@ -26,9 +26,13 @@ class ComponentBase {
|
||||
ComponentBase() = default;
|
||||
virtual ~ComponentBase();
|
||||
|
||||
// ComponentBase hierarchy.
|
||||
// Component hierarchy:
|
||||
ComponentBase* Parent();
|
||||
Component& ChildAt(size_t i);
|
||||
size_t ChildCount() const;
|
||||
void Add(Component children);
|
||||
void Detach();
|
||||
void DetachAllChildren();
|
||||
|
||||
// Renders the component.
|
||||
virtual Element Render();
|
||||
@@ -67,7 +71,6 @@ class ComponentBase {
|
||||
|
||||
private:
|
||||
ComponentBase* parent_ = nullptr;
|
||||
void Detach();
|
||||
};
|
||||
|
||||
using Component = std::shared_ptr<ComponentBase>;
|
||||
|
Reference in New Issue
Block a user