View Single Post
03/30/15, 09:29 PM   #13
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by lightz39 View Post
Ok I had a hunch that was the issue. Thank you. Question about that Get control name you have "" for the suffix. What exactly is that?
Lua Code:
  1. WINDOW_MANAGER:GetControlByName(name, suffix)
It is for the suffix name of the control.

If you needed to get the child of a child of a parent control....
Lets use this as an example, I want to get the control: ZO_PlayerInventoryTabsButton6
"ZO_PlayerInventoryTabs" is a child control of ZO_PlayerInventory
and
"ZO_PlayerInventoryTabsButton6" is a child control of ZO_PlayerInventoryTabs
You could do something like:
Lua Code:
  1. local tabControl = ZO_PlayerInventory:GetNamedChild("Tabs")
  2. local btn6Control = tabControl:GetNamedChild("Button6")
  3. or
  4. local btn6Control = ZO_PlayerInventory:GetNamedChild("Tabs"):GetNamedChild("Button6")

But instead of making the intermediate call to get: ZO_PlayerInventoryTabs control...even though you don't care about it & are only going to use it to grab the: ZO_PlayerInventoryTabsButton6 control. Instead you can just use:
Lua Code:
  1. WINDOW_MANAGER:GetControlByName("ZO_PlayerInventory", "TabsButton6")
and skip over grabbing the ZO_PlayerInventoryTabs control since you don't need it anyhow.


Note: The control your trying to get doesn't have to be the Child of a child of the parent...it was just a decent example of use for the function. You could grab a parents child by doing:
Lua Code:
  1. WINDOW_MANAGER:GetControlByName("ZO_PlayerInventory", "Tabs")

But since "Tabs" is a child of ZO_PlayerInventory, we could also just call:
Lua Code:
  1. local tabControl = ZO_PlayerInventory:GetNamedChild("Tabs")

Last edited by circonian : 03/30/15 at 09:37 PM.
  Reply With Quote