XML StatusBar help
Hiya, I can't seem to get a StatusBar to be created and displayed. Here is the current version of my status bar:
Code:
<StatusBar name="$parent_status" minValue="0" maxValue="100" defaultValue="30" orientation="HORIZONTAL"> Anyone know what I'm missing? |
A parent object?
|
You either need a parent (highly recommended) or a valid attribute for your anchor's "relativeTo" attribute.
If your frame is logically attached to another frame (eg. you're adding another statusbar to the player frame) use that frame as its parent. If your frame is standalone, parent it to the UIParent. Without a parent (or some chain of parentage that leads to the UIParent) your frame will not respect UI scaling changes and won't be hidden when the user presses Alt-Z to hide the UI (eg. when taking a screenshot). Also, the "$parent" token in a frame name should never be used if your frame doesn't have a parent, and should generally not be used if your frame's parent is part of the default UI or some other addon, since it may override something else that already exists, or result in other unexpected behavior. Make sure your frame's name is unique (so it won't conflict with other frames) and clearly identifies your addon (so users can figure out what addon that statusbar they want to move belongs to by using the "/framestack" command or other tools). |
Hi sorry for the confusion, I just posted the relevant part of the XML - the fragment I posted is inside a grey parent frame which is loading and displaying just fine. When I get back to my PC I will try removing the relativeTo property from the anchor tag and see if it loads properly.
|
OK removing the relativeTo property did not cause the scrollbar to load. Anything else i'm missing here?
|
Post your entire code. Posting random snippets is worse than useless, especially when you don't even mention that what you posted isn't your entire code.
|
OK, apparently I didn't say so clearly enough in my first post. Here is what I have:
xml: http://pastebin.com/MAKAqg78 lua: http://pastebin.com/70yzSABc Again, I assume i'm missing some value in my StatusBar XML that is necessary, but I can't seem to find any examples to copy from. |
It's still the same problem. :) As Phanx already wrote:
Quote:
|
Hmm, I must be misunderstanding what you mean by a parent. From my point of view, the parent of the StatusBar is DougFrame. When inspecting the result using /framestack, I can see that my FontString, which i've labelled as $parent_text, is named as "DougFrame_text". Is there some problem with how I have situated the bar inside those Layer tags?
After some mucking about, I moved the statusbar out of the frame structure entirely and just set it's parent attribute to DougFrame, which caused it to load properly. So it does work at least, but i'm not sure why. |
Ahh, I misspelled my "Frames" element as "Frame". Sorry, I did not realise these were two different elements. Working now, thanks for your help!
|
All times are GMT -6. The time now is 05:57 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI