Skip to content

Commit

Permalink
addComponentAt/removeComponentAt
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Jan 17, 2018
1 parent 51d1b68 commit d7c5245
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions haxe/ui/backend/ComponentBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,25 @@ class ComponentBase extends Sprite implements IComponentBase {
return child;
}

private function handleAddComponentAt(child:Component, index:Int):Component {
addChildAt(child, index);
return child;
}

private function handleRemoveComponent(child:Component, dispose:Bool = true):Component {
if (contains(child)) {
removeChild(child);
}
return child;
}

private function handleRemoveComponentAt(index:Int, dispose:Bool = true):Component {
if (getChildAt(index) != null) {
removeChildAt(index);
}
return null;
}

private function handleSetComponentIndex(child:Component, index:Int) {
setChildIndex(child, index);
}
Expand Down

0 comments on commit d7c5245

Please sign in to comment.