Log in

View Full Version : Can you delete controls?



celestian
June 25th, 2019, 04:11
I've a use case where I would like to "getControls()" and then purge them all and rebuild everything.

I can flip through the controls but I can't seem to figure out how to "delete" them. The best I could do was setVis to false but that's not a real solution.

Trenloe
June 25th, 2019, 15:01
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#destroy

celestian
June 25th, 2019, 16:52
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#destroy

Thanks again for the vision ;)

I kept searching for delete/remove, not destroy.



local aControls = getControls();
if #aControls > 1 then
for i=2 , #aControls do
aControls[i].destroy();
end
end


That seems to work. It clears out all but the window (aControls[1]) which is my need.