Once again i need help. I'm trying to dynamically create labels and so far nothing i tried worked. I read the part
"Is there a way to dynamically create controls like buttons or labels?" on Addon Quick Questions on wiki but i can't figure out what i am doing wrong.
First i copy/pasted the xml from the wiki and i removed the button while changing the name of the label and adding virtual = "true", but i was getting the error "CreateControlFromVirtual Failed". After messing around and trying different things (while still getting the failed message) i decided to copy paste and use what wiki had as is, without changing anything, only to find out that i was getting the same error again.
This is the xml (same as wiki):
Code:
<Button name="DynamicButton" virtual="true" text="Click">
<Controls>
<Label name="$(parent)InnerLabel" text="Label" font="ZoFontGame">
<AnchorFill/>
</Label>
</Controls>
</Button>
And this is the lua:
Lua Code:
function OnLoad(eventCode, name)
for i = 1, 10 do
local dynamicControl = CreateControlFromVirtual("DynamicButton", ZO_FriendsListList, "DynamicButton", i)
end
DynamicButton2:SetText("2")
end
The only difference is that i added a TopLevelControl which is the ZO_FriendsListList.
What am i doing wrong here?
I also checked around in the forum and i found that Wykkyd managed to create a dynamicly dropdown menu using WINDOW_MANAGER only, i tried to do it with WINDOW_MANAGER as well but it didn't work ether.
Thanks for your help.