Quote Originally Posted by ZorbaTHut View Post
Quote Originally Posted by Snowreap View Post
when the above addon is run, an error message is printed when "TitleBar:SetPoint("TOP", Main, "TOP", nil, 2)" is executed.
So, here's the problem.At some point, the addon system needs to get the height of Title.Text.Since you've set two points on Title.Text, it calculates the height based on those. First, it tries looking up the top edge. The top edge is set to the top edge of Title (that's on line 13.)Now it has to calculate the position of the top edge of Title. The top edge of Title is set to the left edge of Main, which is named "LayoutTest Window" (that's line 48).Next, it has to figure out where the top edge of Main is. So far, Main's bottom point has been set and nothing else. That means Main still carries its default height. In order to figure out the *top* edge, it goes to calculate the position of the *bottom* edge, which is set to the bottom of TitleBar on line 39.At this point in the code, TitleBar has a height (set on line 20) and an explicitly set top point. That means it can look up the top point to figure out where the bottom point is.Unfortunately, you may notice we're already trying to look up a top point - TitleBar and Title.Text are the same thing, and the top point of TitleBar therefore depends on Title.Text. There's no way to resolve this - we've basically said "A depends on B, which depends on C, which depends on A." So the layout system chokes and gives you an error.One way or another, you need to resolve the circular lookup so that it can actually figure out where the elements are meant to be placed.All that said, thanks for posting this question - I only just now realized that the error dump is upside-down, so, yeah, I'll fix that
Jump to post...