View Single Post
07/11/16, 12:50 PM   #5
tgolsson
Join Date: Jul 2016
Posts: 5
Originally Posted by Haho View Post
your "Addon" level is your TopLevelControl then

then make your virtual be only "Control" and set your toplevelcontrol as parent when your generate them.
later work on your controls as you see fit. But TopLevelControls have specific functions and rules attached to them, and you don't want them on all of your controls.


I usually create everything in lua, but there are many examples of xml in other addons to understand how names are created.


The name you determine in lua is a variable you can check in your code, but for the UI what matter is the named control. You can get it back with a
local mycontrolvariable = GetControl("TopLevelNameChildNameLabelNAme") for example.

in your example :
local mylabel = GetControl("UnitFrameName")
mylabel:SetText("Bob")

edit: Controls dont need to all have a size and place etc, they can be virtual containers for the sake of having properties inherited by a group of children. I mean CT_CONTROL controls...
ooh, that's helpful. I thought I HAD to have a TopLevelControl to contain the controls. This removes a few levels of nesting at least. Can I also then include them in other XML files as long as I load the files in the correct order? So I could make my raidframe with 24 unit frames and two backdrops?
  Reply With Quote