WoW:XML/Frame: Difference between revisions

147 bytes added ,  7 September 2022
Line 122: Line 122:


; Notes
; Notes
A complex visual element is formed of multiple Frames, and it's considered good design to have a related parent frame amongst them. And have the rest use that (or its children) as their parent. By default, all child frames already use the parent they are defined in as their parent. Well behaved UI AddOns will normally want their top-level parent frame, the highest-level frame that is not defined in another frame, to be set expressly to 'UIParent'. Failure to do so means, amongst other things, that the AddOn's frame won't vanish when the Hide UI key is pressed.
Complex visual elements are usually formed using many frames. It's considered good design to have a single related parent frame amongst them. By default, all child frames already use the frame they are defined in as their parent. If some of the frames are defined separately, they can still explicitly set their parent to a common frame, using the 'parent' attribute, and have the rest use that (or its children) as their parent.
 
Well behaved UI AddOns will normally want their top-level parent frame, the highest-level frame that is not defined in another frame, to be set expressly to 'UIParent'. Failure to do so means, amongst other things, that the AddOn's frame won't vanish when the Hide UI key is pressed.


=== Frame Levels ===
=== Frame Levels ===