Should be simple - seems it's not (for me anyway)
I am having trouble understanding the interactions between xml and lua. I have a control:
Code:
<GuiXml> Code:
function WhichSet.OnActionBarChange(event, actionbar) |
Shouldn't you be writing to the label? Which would be WhichSetIndicatorLabel:SetText("test")
|
Rhyono is correct: You should use WhichSetAddonIndicatorLabel.
If you look at the XML, you have name="WhichSetIndicator". So the game makes a TopLevelControl called WhichSetIndicator. WhichSetIndicator is then added to the global table, allowing you to call it using WhichSetIndicator in Lua code. Next, you have name="$(parent)Label". This tells the game to take the name of the parent (WhichSetIndicator:GetName()) and append Label to it (WhichSetIndicator:GetName().."Label") and make that the name of the Label. So then you can call it as WhichSetIndicatorLabel in Lua code. You can also do WhichSetIndicator:GetNamedChild("Label") which might be more readable. I'd also suggest zgoo (specifically, when you have it, do /zgoo WhichSetIndicator) which could help you in the future if you run into problems with UI design. |
Thank you so much for the insight. This should help a lot. I am new to this and have not yet read much LUA reference material. I was relying on previous programming experience in other languages. I guess I had better do my homework. Again, Thank you.
|
All times are GMT -6. The time now is 12:45 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI