MCPcopy Create free account
hub / github.com/TankOs/SFGUI / Remove

Method Remove

src/SFGUI/Desktop.cpp:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void Desktop::Remove( std::shared_ptr<Widget> widget ) {
136 WidgetsList::iterator iter( std::find( m_children.begin(), m_children.end(), widget ));
137
138 if( iter != m_children.end() ) {
139 m_children.erase( iter );
140 }
141
142 if( m_last_receiver.lock() == widget ) {
143 m_last_receiver.reset();
144 }
145
146 RecalculateWidgetLevels();
147
148 if( !m_children.empty() && m_children.front()->GetAllocation().contains( sf::Vector2f( m_last_mouse_pos ) ) ) {
149 SendFakeMouseMoveEvent( m_children.front(), m_last_mouse_pos.x, m_last_mouse_pos.y );
150 }
151}
152
153void Desktop::RemoveAll() {
154 m_children.clear();

Callers 2

SetParentMethod · 0.45
mainFunction · 0.45

Calls 2

endMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected