WoW Widget API (Curated)
This skill documents the Widget API for World of Warcraft Retail. It is curated: it highlights the core types, methods, and patterns you use most. For exhaustive lists, follow the source links.
Source of truth: https://warcraft.wiki.gg/wiki/Widget_API
Script handlers: https://warcraft.wiki.gg/wiki/Widget_script_handlers
XML schema: https://warcraft.wiki.gg/wiki/XML_schema
Current as of: Patch 12.0.0 (Retail)
When to Use This Skill
Use this skill when you need to:
- Create or manipulate UI frames (
CreateFrame, Frame:SetPoint, Frame:Show)
- Work with textures and visual regions (
Texture:SetTexture, TextureBase:SetAtlas)
- Handle font strings and text display (
FontString:SetText, FontInstance:SetFont)
- Build animations (
AnimationGroup:Play, Animation:SetDuration)
- Manage tooltips (
GameTooltip:SetOwner, GameTooltip:AddLine)
- Handle buttons and interactive controls (
Button:SetText, EditBox:SetText, Slider:SetValue)
- Work with status bars and cooldowns (
StatusBar:SetValue, Cooldown:SetCooldown)
- Use model frames for 3D displays (
Model:SetModel, ModelScene:CreateActor)
- Anchor, size, show or hide, and parent UI elements
- Register frames for events (
Frame:RegisterEvent, Frame:RegisterUnitEvent)
- Set up script handlers (
ScriptObject:SetScript, ScriptObject:HookScript)
Widget Hierarchy (Short)
FrameScriptObject
Object
ScriptObject
ScriptRegion (+ ScriptRegionResizing + AnimatableObject)
Region
TextureBase -> Texture, MaskTexture, Line
FontString (+ FontInstance)
Frame (+ FontInstance)
Button -> CheckButton
EditBox, MessageFrame, ScrollFrame, Slider, StatusBar, Cooldown
GameTooltip, SimpleHTML, ColorSelect, MovieFrame
Model -> PlayerModel -> CinematicModel, DressUpModel -> TabardModel
ModelScene -> ModelSceneActor
AnimationGroup -> Animation -> Alpha, Rotation, Scale, Translation, Path, FlipBook
Font (FrameScriptObject + FontInstance)
How to Use This Skill
- Identify the widget type you are working with (for example:
Frame, Texture, Button).
- Check the hierarchy above to find base types it inherits from.
- Open the relevant reference file for core methods and examples.
- Use the source links for exhaustive method lists.
Reference Files
| Reference |
Contents |
| BASE-WIDGETS.md |
Base types, anchoring, input, scripts, visibility |
| TEXTURE-WIDGETS.md |
TextureBase, Texture, MaskTexture, Line |
| FONT-WIDGETS.md |
FontInstance, Font, FontString |
| ANIMATION-WIDGETS.md |
AnimationGroup, Animation, Alpha, Rotation, Scale, Translation, Path |
| FRAME-WIDGETS.md |
Frame core behavior, events, layering, movement |
| FRAME-CONTROLS.md |
Button, CheckButton, EditBox, ScrollFrame, Slider, StatusBar, Cooldown, MessageFrame, SimpleHTML |
| ADVANCED-WIDGETS.md |
GameTooltip, Model/PlayerModel, ModelScene, ColorSelect, MovieFrame |
Core Patterns
Create and Anchor
local frame = CreateFrame("Frame", "MyFrame", UIParent, "BackdropTemplate")
frame:SetSize(240, 120)
frame:SetPoint("CENTER")
local title = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
title:SetPoint("TOP", 0, -12)
title:SetText("Hello")
Events and Scripts
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent", function(self, event)
print("Ready", event)
end)
Buttons
local btn = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
btn:SetSize(120, 32)
btn:SetPoint("CENTER")
btn:SetText("Click")
btn:RegisterForClicks("AnyUp")
btn:SetScript("OnClick", function(self, button)
print("Clicked", button)
end)
Animations
local ag = frame:CreateAnimationGroup()
local fade = ag:CreateAnimation("Alpha")
fade:SetFromAlpha(0)
fade:SetToAlpha(1)
fade:SetDuration(0.25)
ag:Play()
XML Schema Quickstart
<Ui>
<Frame name="MyXmlFrame" parent="UIParent" hidden="true">
<Size x="240" y="120"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Scripts>
<OnLoad>
self:RegisterEvent("PLAYER_LOGIN")
</OnLoad>
<OnEvent>
print(event)
</OnEvent>
</Scripts>
</Frame>
</Ui>
Script Handlers Quick Map
- ScriptRegion:
OnShow, OnHide, OnEnter, OnLeave, OnMouseDown, OnMouseUp, OnMouseWheel
- Frame:
OnEvent, OnUpdate, OnSizeChanged, OnDragStart, OnDragStop, OnKeyDown, OnKeyUp
- Button:
OnClick, OnDoubleClick, PreClick, PostClick
- EditBox:
OnTextChanged, OnEnterPressed, OnEscapePressed, OnTabPressed
- Slider/StatusBar:
OnValueChanged, OnMinMaxChanged
- AnimationGroup/Animation:
OnPlay, OnStop, OnFinished, OnUpdate
For the full handler list by widget type, see https://warcraft.wiki.gg/wiki/Widget_script_handlers.
Specialized Widgets (Summary)
For advanced widgets (GameTooltip, Model, ModelScene, ColorSelect, MovieFrame), see ADVANCED-WIDGETS.md.
Use the Widget API page for full method lists and specialized widget details.
Security Annotations
Methods tagged in the API reference have usage restrictions:
#protected - Blizzard secure code only.
#secureframe - Not callable on protected frames during combat.
#nocombat - Not callable during combat lockdown.
#restrictedframe - Returns nil for protected frames from insecure code in combat.
#anchorfamily - Anchor family restrictions apply.
Sources
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: wow-api-widget3description: Curated guide to the WoW Widget API (Retail). Focuses on core widget types, common methods, and patterns for CreateFrame, anchoring, scripts, textures, fonts, animations, and UI controls. Use when this capability is needed.4---56# WoW Widget API (Curated)78This skill documents the Widget API for World of Warcraft Retail. It is curated: it highlights the core types, methods, and patterns you use most. For exhaustive lists, follow the source links.910> Source of truth: https://warcraft.wiki.gg/wiki/Widget_API11> Script handlers: https://warcraft.wiki.gg/wiki/Widget_script_handlers12> XML schema: https://warcraft.wiki.gg/wiki/XML_schema13> Current as of: Patch 12.0.0 (Retail)1415## When to Use This Skill1617Use this skill when you need to:18- Create or manipulate UI frames (`CreateFrame`, `Frame:SetPoint`, `Frame:Show`)19- Work with textures and visual regions (`Texture:SetTexture`, `TextureBase:SetAtlas`)20- Handle font strings and text display (`FontString:SetText`, `FontInstance:SetFont`)21- Build animations (`AnimationGroup:Play`, `Animation:SetDuration`)22- Manage tooltips (`GameTooltip:SetOwner`, `GameTooltip:AddLine`)23- Handle buttons and interactive controls (`Button:SetText`, `EditBox:SetText`, `Slider:SetValue`)24- Work with status bars and cooldowns (`StatusBar:SetValue`, `Cooldown:SetCooldown`)25- Use model frames for 3D displays (`Model:SetModel`, `ModelScene:CreateActor`)26- Anchor, size, show or hide, and parent UI elements27- Register frames for events (`Frame:RegisterEvent`, `Frame:RegisterUnitEvent`)28- Set up script handlers (`ScriptObject:SetScript`, `ScriptObject:HookScript`)2930## Widget Hierarchy (Short)3132```33FrameScriptObject34 Object35 ScriptObject36 ScriptRegion (+ ScriptRegionResizing + AnimatableObject)37 Region38 TextureBase -> Texture, MaskTexture, Line39 FontString (+ FontInstance)40 Frame (+ FontInstance)41 Button -> CheckButton42 EditBox, MessageFrame, ScrollFrame, Slider, StatusBar, Cooldown43 GameTooltip, SimpleHTML, ColorSelect, MovieFrame44 Model -> PlayerModel -> CinematicModel, DressUpModel -> TabardModel45 ModelScene -> ModelSceneActor4647AnimationGroup -> Animation -> Alpha, Rotation, Scale, Translation, Path, FlipBook48Font (FrameScriptObject + FontInstance)49```5051## How to Use This Skill52531. Identify the widget type you are working with (for example: `Frame`, `Texture`, `Button`).542. Check the hierarchy above to find base types it inherits from.553. Open the relevant reference file for core methods and examples.564. Use the source links for exhaustive method lists.5758## Reference Files5960| Reference | Contents |61|-----------|----------|62| [BASE-WIDGETS.md](references/BASE-WIDGETS.md) | Base types, anchoring, input, scripts, visibility |63| [TEXTURE-WIDGETS.md](references/TEXTURE-WIDGETS.md) | TextureBase, Texture, MaskTexture, Line |64| [FONT-WIDGETS.md](references/FONT-WIDGETS.md) | FontInstance, Font, FontString |65| [ANIMATION-WIDGETS.md](references/ANIMATION-WIDGETS.md) | AnimationGroup, Animation, Alpha, Rotation, Scale, Translation, Path |66| [FRAME-WIDGETS.md](references/FRAME-WIDGETS.md) | Frame core behavior, events, layering, movement |67| [FRAME-CONTROLS.md](references/FRAME-CONTROLS.md) | Button, CheckButton, EditBox, ScrollFrame, Slider, StatusBar, Cooldown, MessageFrame, SimpleHTML |68| [ADVANCED-WIDGETS.md](references/ADVANCED-WIDGETS.md) | GameTooltip, Model/PlayerModel, ModelScene, ColorSelect, MovieFrame |6970## Core Patterns7172### Create and Anchor73```lua74local frame = CreateFrame("Frame", "MyFrame", UIParent, "BackdropTemplate")75frame:SetSize(240, 120)76frame:SetPoint("CENTER")7778local title = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")79title:SetPoint("TOP", 0, -12)80title:SetText("Hello")81```8283### Events and Scripts84```lua85local f = CreateFrame("Frame")86f:RegisterEvent("PLAYER_LOGIN")87f:SetScript("OnEvent", function(self, event)88 print("Ready", event)89end)90```9192### Buttons93```lua94local btn = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")95btn:SetSize(120, 32)96btn:SetPoint("CENTER")97btn:SetText("Click")98btn:RegisterForClicks("AnyUp")99btn:SetScript("OnClick", function(self, button)100 print("Clicked", button)101end)102```103104### Animations105```lua106local ag = frame:CreateAnimationGroup()107local fade = ag:CreateAnimation("Alpha")108fade:SetFromAlpha(0)109fade:SetToAlpha(1)110fade:SetDuration(0.25)111ag:Play()112```113114## XML Schema Quickstart115116```xml117<Ui>118 <Frame name="MyXmlFrame" parent="UIParent" hidden="true">119 <Size x="240" y="120"/>120 <Anchors>121 <Anchor point="CENTER"/>122 </Anchors>123 <Scripts>124 <OnLoad>125 self:RegisterEvent("PLAYER_LOGIN")126 </OnLoad>127 <OnEvent>128 print(event)129 </OnEvent>130 </Scripts>131 </Frame>132</Ui>133```134135## Script Handlers Quick Map136137- ScriptRegion: `OnShow`, `OnHide`, `OnEnter`, `OnLeave`, `OnMouseDown`, `OnMouseUp`, `OnMouseWheel`138- Frame: `OnEvent`, `OnUpdate`, `OnSizeChanged`, `OnDragStart`, `OnDragStop`, `OnKeyDown`, `OnKeyUp`139- Button: `OnClick`, `OnDoubleClick`, `PreClick`, `PostClick`140- EditBox: `OnTextChanged`, `OnEnterPressed`, `OnEscapePressed`, `OnTabPressed`141- Slider/StatusBar: `OnValueChanged`, `OnMinMaxChanged`142- AnimationGroup/Animation: `OnPlay`, `OnStop`, `OnFinished`, `OnUpdate`143144For the full handler list by widget type, see https://warcraft.wiki.gg/wiki/Widget_script_handlers.145146## Specialized Widgets (Summary)147148For advanced widgets (GameTooltip, Model, ModelScene, ColorSelect, MovieFrame), see [ADVANCED-WIDGETS.md](references/ADVANCED-WIDGETS.md).149Use the Widget API page for full method lists and specialized widget details.150151## Security Annotations152153Methods tagged in the API reference have usage restrictions:154- `#protected` - Blizzard secure code only.155- `#secureframe` - Not callable on protected frames during combat.156- `#nocombat` - Not callable during combat lockdown.157- `#restrictedframe` - Returns nil for protected frames from insecure code in combat.158- `#anchorfamily` - Anchor family restrictions apply.159160## Sources161162- https://warcraft.wiki.gg/wiki/Widget_API163- https://warcraft.wiki.gg/wiki/Widget_script_handlers164- https://warcraft.wiki.gg/wiki/XML_schema165166---167> Converted and distributed by [TomeVault](https://tomevault.io/claim/jburlison) — claim your Tome and manage your conversions.168<!-- tomevault:4.0:skill_md:2026-04-13 -->