Quantcast WoWInterface - View Single Post - Setting (and changing) anchors
View Single Post
09-19-19, 07:48 PM   #1
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Oct 2012
Posts: 2
Setting (and changing) anchors

I have a very simple add-on that displays four pieces of information textually instead of with a visual representation - each on their own frame. Each one can be turned on an off at the discretion of the user. I would like these frames to all be anchored to each other horizontally. Easy enough right? Anchor left edge of Frame2 to the right edge of Frame 1, Frame3 to Frame2 in the same manner, etc. But what if Frame2 is disabled? Then Frame3 needs to be anchored to Frame1.

I tried to run Frame:GetChildren() on an anchor frame to count the children and anchor them to the anchor frame itself instead of to each other, but Frame:GetChildren() returns a table of tables, and the "#" operator doesn't count tables.

As a bonus, I would like the user to be able to change the order of the frames - 3, 1, 4, 2; 4, 2, 3, 1; etc.

The question of how to do this has consumed me all day today. Perhaps it's the lack of sleep, or perhaps the lack of Lua experience. Either way, any help would be much appreciated.
  Reply With Quote