| 98 | } |
| 99 | |
| 100 | void GuiComponent::removeChild(GuiComponent* cmp) |
| 101 | { |
| 102 | if(cmp->getParent() != this) |
| 103 | { |
| 104 | LOG(LogError) << "Tried to remove child from incorrect parent!"; |
| 105 | } |
| 106 | |
| 107 | cmp->setParent(NULL); |
| 108 | |
| 109 | for(auto i = mChildren.begin(); i != mChildren.end(); i++) |
| 110 | { |
| 111 | if(*i == cmp) |
| 112 | { |
| 113 | mChildren.erase(i); |
| 114 | return; |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | void GuiComponent::clearChildren() |
| 120 | { |