WoW:XML/Frame: Difference between revisions

143 bytes added ,  15 August 2023
m
Move page script moved page XML/Frame to WoW:XML/Frame without leaving a redirect
m (Move page script moved page XML/Frame to WoW:XML/Frame without leaving a redirect)
 
(2 intermediate revisions by one other user not shown)
Line 104: Line 104:


=== Parents ===
=== Parents ===
Frames can have a parent frame. By default, the parent of any child frame is the frame the child is defined in.
Frames have a parent frame. By default, the parent of any child frame is the frame the child is defined in.


<pre>
<pre>
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 ===
Anonymous user