ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Clearing Controls (https://www.esoui.com/forums/showthread.php?t=689)

Sharp 04/08/14 07:31 AM

Clearing Controls
 
Hello,

I've been looking around for a while, but I cannot seem to find anything on it. Is there a function to clear controls that have been created through LUA using WINDOW_MANAGER? As far as I've seen, there is only a clear anchor, and toggle hidden.

Thanks,
Sharp

ingeniousclown 04/08/14 08:19 AM

There are plenty of posts around asking about this same thing. You can look for them if you want the details but here's the general answer:

You can not and should not delete controls. If you need to delete controls because you're afraid of overflowing and creating too many, then you need to keep re-using old ones.

ZO_ObjectPool gives you a good way to dynamically create controls. I believe LootDrop uses it. It's worth studying.

Sharp 04/08/14 08:23 AM

Thanks for the info. I was not sure if it was viable or not to just delete and recreate controls or not. Now I know.

thelegendaryof 04/08/14 10:10 AM

I've tried digging in on that before. Right now there doesn't seem to be a native function for that. Even if you clear everything pointing to it and the garbage collector grabs those pointers up the controls itself won't get removed and stay behind half broken (meaning you can't access them anymore but they're still there).

So yes - just hide and relink them if needed. And don't create any controls you don't need - of course.


All times are GMT -6. The time now is 06:45 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI