ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   procedural creation of UI elements (https://www.esoui.com/forums/showthread.php?t=9395)

Mipps 09/28/20 06:35 AM

procedural creation of UI elements
 
1)
Is there a posibility/library to create UI elements beside hardcoded XML?

for example when I want to create dynamicly a progressbar for each value in a table:

for i,value in pairs(table) do
spawnProgressBar(value) --dummy funciton!!!!!!
end

2)
comming from wow addon programming: In "blizzLUA" you cannot destroy an existing frame (without reloading UI)... (in blizzLUA every UI element inherits from base class "frame")
so can you do such things in "esoLUA" like: destroy(progressBar01) / progressBar01 = nil ?

sirinsidiator 09/28/20 07:40 AM

You can create new elements from Lua code via the window manager. Either by creating everything from scratch and setting all the values manually, or by using xml templates. However, you can never destroy a control once it has been created. That's why you should absolutely use a control pool and reuse them when you do any dynamic allocations like that.
You can find more information in part 6 and part 7 of the simple notebook tutorial.


All times are GMT -6. The time now is 05:03 PM.

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