So I have a TreeGroup in my addon with a 2-level structure (some pages have sub-pages). I am wondering if there is any way of making everything expanded by default. What I've done in the past is just use SelectByPath() to load every page which would then expand and reveal all its sub-pages but this is causing an error with some new code that I added because it is trying to access another module that hasn't loaded yet which is kind of a catch-22 situation where the module with the treestructure has to load before the module it is trying to access for other reasons.
There isn't anything in the documentation for this and I couldn't find anything via google or searching the forums.
Is there some way of doing this using a status table? I am already using one to set the treewidth.
local treeStructure = {
{value = 1, text = L["Status"]},
{value = 2, text = L["Enchants"], children = {
{value = 1, text = L["2H Weapon"]},
{value = 2, text = L["Boots"]},
{value = 3, text = L["Bracers"]},
{value = 4, text = L["Chest"]},
{value = 5, text = L["Cloak"]},
{value = 6, text = L["Gloves"]},
{value = 7, text = L["Shield"]},
{value = 8, text = L["Staff"]},
{value = 9, text = L["Weapon"]},
}
},
{value = 3, text = L["Materials"]},
{value = 4, text = L["Totals / Queue"]},
{value = 5, text = L["Options"], children = {
{value = 1, text = L["Profiles"]},
{value = 2, text = L["Add Enchants"]},
{value = 3, text = L["Manage Enchants"]},
{value = 4, text = L["Remove Enchants"]},
{value = 5, text = L["Lock Mat Costs"]}
}
},
{value = 6, text = L["Help"], children = {
{value = 1, text = L["Adding Enchants"]},
}
},
{value = 8, text = L["About"]},
{value = 9, text = "Quick Auctions 3"},
}
If that was all you had (just the treegroup with the above structure) when you first open the frame, you wouldn't see any of the child entries (such as "2H Weapon" and "Remove Enchants") you would only see the 9 main groups with an icon to the right of them.
And then when I open the GUI after doing that all the groups are expanded and I can see all the child groups.
My question is: Is there a way to expand all of the groups without using SelectByPath()? Perhaps some value that can be passed as part of an external status table via TreeGroup:SetStatusTable()
Just been looking at doing this myself. From looking at the TreeGroup code, I have managed to get this to work:
local treeStructure = { ... as your post ... }
-- Create tree and set status table.
WidgetTree = AceGUI:Create( "TreeGroup" )
WidgetTree:SetTree( treeStructure )
TreeGroupStatus = { groups = {} }
WidgetTree:SetStatusTable( TreeGroupStatus )
--Tell tree that parent 2 should expand.
TreeGroupStatus.groups[2] = true
-- Refresh tree here.
There isn't anything in the documentation for this and I couldn't find anything via google or searching the forums.
Is there some way of doing this using a status table? I am already using one to set the treewidth.
Thanks for the help in advance.
what addon?
I'm not sure if you understand what I'm asking so I'll try to explain it in more detail.
I have a tree group (http://www.wowace.com/addons/ace3/pages/ace-gui-3-0-widgets/#w-tree-group) inside of a Frame and the treegroup has a two level tree structure that defines it:
If that was all you had (just the treegroup with the above structure) when you first open the frame, you wouldn't see any of the child entries (such as "2H Weapon" and "Remove Enchants") you would only see the 9 main groups with an icon to the right of them.
Now what I have done in the past is this:
And then when I open the GUI after doing that all the groups are expanded and I can see all the child groups.
My question is: Is there a way to expand all of the groups without using SelectByPath()? Perhaps some value that can be passed as part of an external status table via TreeGroup:SetStatusTable()
P.S. This is for my addon, Scroll Master.
In your case, this should make "Enchants" expand.