Universite-Gustave-Eiffel / I-Simpa

An Open Source software for 3D sound propagation modelling
https://i-simpa.univ-gustave-eiffel.fr/
GNU General Public License v3.0
228 stars 56 forks source link

Update displayed tree after Element->Hide() method. #115

Closed wbinek closed 7 years ago

wbinek commented 7 years ago

Hello, I am very, very sorry for bothering you again.

I am trying to dynamically hide or show some nodes from calculation core settings tree. The problem I have is that when I use hide method on visible node it gets hidden only after the project is saved and reloaded.

I know I can delete the element - it disappears immediately, but then I would need to store the copy of the node in case it would need to be shown again - which seams like a ugly solution.

Apparently can't find a way to force tree update after Element->Hide(). I've tried using Modified() method on parent node but it didn't work as expected.

Could you please tell me if there is some way of doing it I can't see?

wbinek commented 7 years ago

I've found a solution. I can use reparent method.

el = this->GetElementByType(ELEMENT_TYPE_CORE_SPPSNEE_AGH_ADVANCED);
el->Hide();
el->Reparent(this);