Virtual XML template
Jump to navigation
Jump to search
Virtual XML templates[1] (or deferred nodes[2]) extend the Widget API by allowing widgets to inherit properties.
<Frame name="MyFrameTemplate" virtual="true" /> <Frame inherits="MyFrameTemplate" /> CreateFrame("Frame", nil, nil, "MyFrameTemplate")
Usage
- Add
virtual="true"
(and a name) in XML to any kind of <LayoutFrame>, <Animation> or <AnimationGroup>. - New widgets may inherit templates using a comma-delimited list of template names:
- The
inherits=""
attribute in XML. - The fourth argument in CreateFrame().
- The
- FrameXML provides numerous templates that AddOns may use, including:
- A complete list (compiled by Ketho); and
- Several basic widget appearances (SharedUIPanelTemplates.xml, archived at Townlong-Yak).
Details
- Templates do not reside in the global environment (_G) during runtime; they exist in a separate state.[3]
- Reusing the same name on two virtual templates will throw a warning in
Logs/FrameXML.log
and in-game.[2]
Patch changes
- Patch 8.0.1 (2018-07-17): Reusing the same template name now throws an in-game error.[2]
- Patch 1.11.0 (2006-06-19): Now available during runtime through CreateFrame() or with LoadOnDemand.[4]
- Templates previously existed only temporarily during the AddOn loading process[5]
- Templates previously existed only temporarily during the AddOn loading process[5]
See also
- Intrinsic frame - Alternative means to extend the widget API.
References
- ^ Ornyx 2016-10-04. Notable UI Changes Coming in 7.1. Archived from the original
- ^ a b c LanceDH, Ammako, Gethe, Necairiel, et al. 2018-07-01. Deferred XML Node object named <name> already exists. WoWInterface.
- ^ Mayron et al. 2015-06-24. re:XML virtual object. WoWInterface.
- ^ slouken 2006-05-23. Re: Upcoming 1.11 Changes - Concise List. Archived from the original
- ^ slouken. Re: Upcoming 1.7 Changes - Concise List. Archived from the original