How to destroy control elements
I have a bunch of unnamed control windows in my TopLevelControl. Depending on the situation the controls are different, but the TopLevelControl and it's background remain the same. How can i destroy these control elements nicely ?
|
Quote:
Second, you can not destroy controls. Once they're created, they exist until you reloadui. You should aim to re-use controls as much as you feasibly can. |
It is not required to name controls.
I could reuse the controls, but the code would be unnecessary complex. They kinda are all labels, but indentation may differ, they have different event handlers and so on. it would be more easier to destroy and recreate. But if it is not possible, then i am forced to reuse :) |
I could be wrong but there is no way to delete controls once they've been created, short of reloading the UI.
The best way to work with "temporary" controls is to use ZO_ObjectPool |
Quote:
I'm not sure what your context is, but you could do kind of what the options menu does. The options window is home to a number of option panels, access to which changes depending on which options menu you went to open. It would require a bit of engineering, but based on you description that seems like a possible solution for you. |
You can just give a nil value for the name. I am not sure it is bad behavior to do so. But if you never going to reference the control by name, why name it then, and pollute the namespace.
|
Quote:
Other than my options menus (using LAM), I never name any controls other than the 'base' that serves as my mods main addon table. |
Yes, there are some ZO templates that require a frame name in order to function properly. This is if they use $(parent) when naming children and/or when utilizing other functions that reference the frame name, as mentioned.
However, if you are creating the controls yourself, you can just use nil in place of a global frame name/reference. |
All times are GMT -6. The time now is 07:46 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI