Thread Tools Display Modes
04/08/14, 07:31 AM   #1
Sharp
 
Sharp's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
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
  Reply With Quote
04/08/14, 08:19 AM   #2
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
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.
  Reply With Quote
04/08/14, 08:23 AM   #3
Sharp
 
Sharp's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 32
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.
  Reply With Quote
04/08/14, 10:10 AM   #4
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
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.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Clearing Controls

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off