Widget API

From WoWWiki

Jump to: navigation, search

Main Menu

WoW API

Widget API

Lua
functions

User Functions

Events

HOWTOs

UI Tech.

XML UI

Category
nav.

→ Widgets

Contents

1 Root Widgets

1.1 UIObject

2 UIObject
Derivatives

2.1 FontInstance

2.2 Region

3 FontInstance
Derivatives

3.1 Font

4 Region
Derivatives

4.1 Frame

4.2 LayeredRegion

5 Frame
Derivatives

5.1 Button

5.2 Cooldown

5.3 ColorSelect

5.4 EditBox

5.5 GameTooltip

5.6 MessageFrame

5.7 Minimap

5.8 Model

5.9 ScrollFrame

5.10 ScrollingMessageFrame

5.11 SimpleHTML

5.12 Slider

5.13 StatusBar

6 Button
Derivatives

6.1 CheckButton

6.2 LootButton

7 Model
Derivatives

7.1 PlayerModel

8 PlayerModel
Derivatives

8.1 DressUpModel

8.2 TabardModel

9 LayeredRegion
Derivatives

9.1 Texture

9.2 FontString

10 Special

10.1 WorldFrame

10.2 Secure
Frames

10.3 Drop Down
Menus

Interface
Customization » Widget API

This is a list of all of the Widget functions found by scanning the
in-game environment. This derivation has been performed independently by at
least two people (Lego and Flickering) so there's a high
degree of confidence the list is correct.

This list is current as of patch 0.11.0-5428 (11100).

A list of Widget Events may be found at the Widget Handlers page.

See Also: Secure Frames
Overview for help with WoW 2.0's secure frame templates

[edit]
Root Widgets

[edit]
UIObject

This is an abstract UI object type which cannot actually be created. It's a
base of all UI objects and gathers together some of common methods which have
identical behaviours across all widget types. See UIObject
object information for details.

UIObject:GetAlpha()
- Return this object's alpha (transparency) value.

UIObject:GetName()
- Return the name of the object.

UIObject:GetObjectType()
- Get the type of this object.

UIObject:IsObjectType("type")
- Determine if this object is of the specified type, or a subclass of that
type.

UIObject:SetAlpha(alpha)
- Set the object's alpha (transparency) value.

[edit]
UIObject Derivatives

[edit]
FontInstance

This is another abstract object type that groups together a number of font
related methods that are used by multiple other widget types. This doesn't have
a direct correlation to a UI object. See FontInstance
object information for details.

FontInstance has all of the methods from UIObject, plus the
following:

FontInstance:GetFont()
- Return the font file, height, and flags.

FontInstance:GetFontObject()
- Return the 'parent' Font object, or nil if none.

FontInstance:GetJustifyH()
- Return the horizontal text justification.

FontInstance:GetJustifyV()
- Return thevertical text justification.

FontInstance:GetShadowColor()
- Returns the color of text shadow (r, g, b, a).

FontInstance:GetShadowOffset()
- Returns the text shadow offset (x, y).

FontInstance:GetSpacing()
- Returns the text spacing.

FontInstance:GetTextColor()
- Returns the default text color.

FontInstance:SetFont("path",
height[,"flags"]) - Sets the font to use for text, returns 1 if the path was
valid, nil otherwise (no change occurs).

FontInstance:SetFontObject(fontObject)
- Sets the 'parent' Font object from which this object inherits properties.

FontInstance:SetJustifyH("justifyH")
- Sets horizontal text justification ("LEFT","RIGHT", or "CENTER")

FontInstance:SetJustifyV("justifyV")
- Sets vertical text justification ("TOP","BOTTOM", or "MIDDLE")

FontInstance:SetShadowColor(r,
g, b[, a]) - Sets the text shadow color.

FontInstance:SetShadowOffset(x,
y) - Sets the text shadow offset.

FontInstance:SetSpacing(spacing)
- Sets the spacing between lines of text in the object.

FontInstance:SetTextColor(r,
g, b[, a]) - Sets the default text color.

[edit]
Region

This is an abstract object type which cannot actually be created. It gathers
together a number of common methods which have identical behaviours across all
widget types. This object contains a collection of methods that are related to
the size, location and visibility of a widget. Note that it is not directly
related to Frame:GetRegions() et al. See Region
object information for details.

Region has all of the methods from UIObject, plus the
following:

Region:ClearAllPoints()
- Clear all attachment points for this object.

Region:GetBottom() -
Get the y location of the bottom edge of this frame - Moved in 1.10.

Region:GetCenter()
- Get the coordinates of the center of this frame - Moved in 1.10.

Region:GetHeight() -
Get the height of this object.

Region:GetLeft() - Get
the x location of the left edge of this frame - Moved in 1.10.

Region:GetNumPoints()
- Get the number of anchor points for this frame - New in 1.10.

Region:GetParent()
- Get the parent of this frame (The object, not just the name) - Moved in
1.10.

Region:GetPoint(pointNum)
- Get details for an anchor point for this frame (point, relativeTo,
relativePoint, xofs, yofs) - New in 1.10.

Region:GetRight() - Get
the x location of the right edge of this frame - Moved in 1.10.

Region:GetTop() - Get the
y location of the top edge of this frame - Moved in 1.10.

Region:GetWidth() - Get
the width of this object.

Region:Hide() - Set this
object to hidden (it and all of its children will disappear).

Region:IsProtected()
- Determine if this object can be manipulated in certain ways by tainted code
in combat or not

Region:IsShown() -
Determine if this object is shown (would be visible if its parent was
visible).

Region:IsVisible() -
Get whether the object is visible on screen (logically (IsShown() and
GetParent():IsVisible()));

Region:SetAllPoints(frame
or "frameName") - Set all anchors to match edges of specified frame - Moved in
1.10.

Region:SetHeight(height)
- Set the height of the object.

Region:SetParent(parent
or "parentName") - Set the parent for this frame - Moved in 1.10.

Region:SetPoint("point","relativeFrame"
or relativeObject,"relativePoint"[, xOfs, yOfs]) - Set an attachment point of
this object - Updated in 1.10.

Region:SetWidth(width) -
Set the width of the object.

Region:Show() - Set this
object to shown (it will appear if its parent is visible).

[edit]
FontInstance Derivatives

[edit]
Font

This object was introduced in 1.10 to replace virtual FontStrings, it allows
for dynamic inheritance of font template changes. The standard UI fonts such as
GameFontNormal are now Font objects. See Font
object information for details.

Font has all of the methods from UIObject and FontInstance, plus the
following:

Font:CopyFontObject(otherFont)
- Set this Font's attributes to be a copy of the otherFont font object's.

The following Frame Derivatives
also inherit all of the functions of the FontInstance type:

EditBox

MessageFrame

ScrollingMessageFrame

The following LayeredRegion
Derivatives also inherit all of the functions of the FontInstance type:

FontString

[edit]
Region Derivatives

[edit]
Frame

See Frame
object information for details.

Frame has all of the methods from UIObject and Region, plus the following:

Frame:CreateFontString(["name"[,"layer"[,"inheritsFrom"]]])
- Create and return a new FontString as a child of this Frame - Can
instantiate virtuals in 1.11.

Frame:CreateTexture(["name"[,"layer"]][,"inheritsFrom"])
- Create and return a new Texture as a child of this Frame - Can instantiate
virtuals in 1.11.

Frame:CreateTitleRegion()
- Create a title region for the frame if it does not have one. - New in 1.11

Frame:DisableDrawLayer("layer")
- Disable rendering of "regions" (fontstrings, textures) in the specified draw
layer.

Frame:EnableDrawLayer("layer")
- Enable rendering of "regions" (fontstrings, textures) in the specified draw
layer.

Frame:EnableKeyboard(enableFlag)
- Set whether this frame will get keyboard input. PROTECTED as of 2.0

Frame:EnableMouse(enableFlag)
- Set whether this frame will get mouse input. PROTECTED as of 2.0

Frame:EnableMouseWheel(enableFlag)
- Set whether this frame will get mouse wheel notifications. PROTECTED as of
2.0

Frame:GetBackdrop()
- Creates and returns a backdrop table suitable for use in SetBackdrop - New
in 1.11.

Frame:GetBackdropBorderColor()
- Gets the frame's backdrop border color (r, g, b, a)- New in 1.11.

Frame:GetBackdropColor()
- Gets the frame's backdrop color (r, g, b, a)- New in 1.11.

Frame:GetChildren() -
Get the list of "children" (frames and things derived from frames) of this
frame.

Frame:GetEffectiveScale()
- Get the scale factor of this object relative to the root window.

Frame:GetFrameLevel()
- Get the level of this frame.

Frame:GetFrameStrata()
- Get the strata of this frame.

Frame:GetFrameType()
- Get the type of this frame.

Frame:GetHitRectInsets()
- Gets the frame's hit rectangle inset distances (l, r, t, b) - new in 1.11.

Frame:GetID()
- Get the ID of this frame.

Frame:GetMaxResize()
- Gets the frame's maximum allowed resize bounds (w, h) - new in 1.11.

Frame:GetMinResize()
- Gets the frame's minimum allowed resize bounds (w, h) - new in 1.11.

Frame:GetNumChildren()
- Get the number of "children" (frames and things derived from frames) this
frame has.

Frame:GetNumRegions()
- Return the number of "regions" (fontstrings, textures) belonging to this
frame.

Frame:GetRegions()
- Return the "regions" (fontstrings, textures) of the frame (multiple return
values) belonging to this frame.

Frame:GetScale()
- Get the scale factor of this object relative to its parent.

Frame:GetScript("handler")
- Get the function for one of this frame's handlers.

Frame:GetTitleRegion()
- Return the frame's title region - New in 1.11.

Frame:HasScript("handler")
- Return true if the frame can be given a handler of the specified type (NOT
whether it actually HAS one, use GetScript for that) - Since 1.8.

Frame:IsClampedToScreen()
- Gets whether the frame is prohibited from being dragged off screen - New in
1.11.

Frame:IsFrameType("type")
- Determine if this frame is of the specified type, or a subclass of that
type.

Frame:IsKeyboardEnabled()
- Get whether this frame will get keyboard input. - New in 1.11.

Frame:IsMouseEnabled()
- Get whether this frame will get mouse input. - New in 1.11.

Frame:IsMouseWheelEnabled()
- Get whether this frame will get mouse wheel notifications. New in 1.11.

Frame:IsMovable()
- Determine if the frame can be moved.

Frame:IsResizable()
- Determine if the frame can be resized.

Frame:IsToplevel()
- Get whether the frame is set as toplevel - New in 1.10.2.

Frame:IsUserPlaced()
- Determine if this frame has been relocated by the user.

Frame:Lower()
- Lower this frame behind other frames.

Frame:Raise()
- Raise this frame above other frames.

Frame:RegisterAllEvents()
- Register this frame to receive all events (For debugging purposes only!) -
New in 1.11.

Frame:RegisterEvent("event")
- Indicate that this frame should be notified when event occurs.

Frame:RegisterForDrag("buttonType"[,"buttonType"...])
- Inidicate that this frame should be notified of drag events for the
specified buttons.

Frame:SetBackdrop([backdropTable])
- Set the backdrop of the frame according to the specification provided.

Frame:SetBackdropBorderColor(r,
g, b[, a]) - Set the frame's backdrop's border's color.

Frame:SetBackdropColor(r,
g, b[, a]) - Set the frame's backdrop color.

Frame:SetClampedToScreen(clamped)
- Set whether the frame is prohibited from being dragged off screen - New in
1.11.

Frame:SetFrameLevel(level)
- Set the level of this frame (determines which of overlapping frames shows on
top).

Frame:SetFrameStrata("strata")
- Set the strata of this frame.

Frame:SetHitRectInsets(left,
right, top, bottom) - Set the inset distances for the frame's hit rectangle -
New in 1.11.

Frame:SetID(id)
- Set the ID of this frame.

Frame:SetMaxResize(maxWidth,
maxHeight) - Set the maximum dimensions this frame can be resized to.

Frame:SetMinResize(minWidth,
minHeight) - Set the minimum dimensions this frame can be resized to.

Frame:SetMovable(isMovable)
- Set whether the frame can be moved.

Frame:SetResizable(isResizable)
- Set whether the frame can be resized.

Frame:SetScale(scale) -
Set the scale factor of this frame relative to its parent.

Frame:SetScript("handler",
function) - Set the function to use for a handler on this frame.

Frame:SetToplevel(isTopLevel)
- Set whether the frame should raise itself when clicked - New in 1.10.2.

Frame:SetUserPlaced(isUserPlaced)
- Set whether the frame has been relocated by the user (and will thus be saved
in the layout cache).

Frame:StartMoving() -
Start moving this frame.

Frame:StartSizing("point")
- Start sizing this frame using the specified anchor point.

Frame:StopMovingOrSizing()
- Stop moving and/or sizing this frame.

Frame:UnregisterAllEvents()
- Indicate that this frame should no longer be notified when any events occur.

Frame:UnregisterEvent("event")
- Indicate that this frame should no longer be notified when event occurs.

[edit]
LayeredRegion

Another abstract type, for objects that represent only a rendering process
onto the screen, rather than a full blown frame. (See LayeredRegion
object information for details) LayeredRegion has all of the methods from UIObject and Region, plus the
following:

LayeredRegion:GetDrawLayer()
- Returns the draw layer for the Region - New in 1.10.

LayeredRegion:SetDrawLayer("layer")
- Sets the draw layer for the Region - New in 1.10.

LayeredRegion:SetVertexColor(r,
g, b[, alpha])

[edit]
Frame Derivatives

[edit]
Button

See Button
object information for details.

Button has all of the methods from UIObject, Region and Frame, plus the following:

Button:Click()
- Execute the click action of the button.

Button:Disable()
- Disable the Button so that it cannot be clicked.

Button:Enable()
- Enable to the Button so that it may be clicked.

Button:GetButtonState()
- Return the current state ("PUSHED","NORMAL") of the Button.

Button:GetDisabledFontObject()
- Return the font object for the Button when disabled - New in 1.10.

Button:GetDisabledTextColor()
- Get the color of this button's text when disabled (r, g, b, a) - New in
1.11.

Button:GetDisabledTexture()
- Get the texture for this button when disabled - New in 1.11.

Button:GetFont()
- Returns the font, size, and flags currently used for display on the Button.

Button:GetFontString()
- Get this button's label FontString - New in 1.11.

Button:GetHighlightFontObject()
- Return the font object for the Button when highlighted - New in 1.10.

Button:GetHighlightTextColor()
- Get the color of this button's text when highlighted (r, g, b, a) - New in
1.11.

Button:GetHighlightTexture()
- Get the texture for this button when highlighted - New in 1.11.

Button:GetNormalTexture()
- Get the normal texture for this button - New in 1.11.

Button:GetPushedTextOffset()
- Get the text offset when this button is pushed (x, y) - New in 1.11.

Button:GetPushedTexture()
- Get the texture for this button when pushed - New in 1.11.

Button:GetText() - Get
the text label for the Button.

Button:GetTextColor()
- Get the normal color of this button's text (r, g, b, a) - New in 1.11.

Button:GetTextFontObject()
- Return the font object for the Button's normal text - New in 1.10.

Button:GetTextHeight()
- Get the height of the Button's text.

Button:GetTextWidth()
- Get the width of the Button's text.

Button:IsEnabled() -
Determine whether the Button is enabled.

Button:LockHighlight()
- Set the Button to always be drawn highlighted.

Button:RegisterForClicks("clickType"[,"clickType"...])
- Specify which mouse button up/down actions cause this button to receive an
OnClick notification.

Button:SetButtonState("state"[,
lock]) - Set the state of the Button ("PUSHED", "NORMAL") and whether it is
locked.

Button:SetDisabledFontObject([font])
- Set the font object for settings when disabled - New in 1.10.

Button:SetDisabledTextColor(r,
g, b[, a]) - Set the disabled text color for the Button.

Button:SetDisabledTexture(texture
or "texturePath") - Set the disabled texture for the Button - Updated in 1.10.

Button:SetFont("font",
size[,"flags"]) - Set the font to use for display.

Button:SetFontString(fontString)
- Set the button's label FontString - New in 1.11.

Button:SetHighlightFontObject([font])
- Set the font object for settings when highlighted - New in 1.10.

Button:SetHighlightTextColor(r,
g, b[, a]) - Set the highlight text color for the Button.

Button:SetHighlightTexture(texture
or "texturePath") - Set the highlight texture for the Button - Updated in
1.10.

Button:SetNormalTexture(texture
or "texturePath") - Set the normal texture for the Button - Updated in 1.10.

Button:SetPushedTextOffset(x,
y) - Set the text offset for this button when pushed - New in 1.11.

Button:SetPushedTexture(texture
or "texturePath") - Set the pushed texture for the Button - Updated in 1.10.

Button:SetText("text") -
Set the text label for the Button.

Button:SetTextColor(r,
g, b) - Set the text color for the Button.

Button:SetTextFontObject([font])
- Set the font object from which to get settings for this Button's normal
state - New in 1.10.

Button:UnlockHighlight()
- Set the Button to not always be drawn highlighted.

[edit]
Cooldown

Cooldown has all of the methods from UIObject, Region and Frame, plus the following:

Cooldown:SetCooldown(Start,
Duration)

[edit]
ColorSelect

See ColorSelect
object information for details.

ColorSelect has all of the methods from UIObject, Region and Frame, plus the following:

ColorSelect:GetColorHSV()
- Get the HSV values of the selected color.

ColorSelect:GetColorRGB()
- Get the RGB values of the selected color.

ColorSelect:GetColorValueTexture()
- Get the texture used to show color value - new in 1.11.

ColorSelect:GetColorValueThumbTexture()
- Get the texture for the color value thumb - New in 1.11.

ColorSelect:GetColorWheelTexture()
- Get the texture for the color wheel - New in 1.11.

ColorSelect:GetColorWheelThumbTexture()
- Get the texture for the color wheel thumb - New in 1.11.

ColorSelect:SetColorHSV(h,
s, v) - Set to a specific HSV color.

ColorSelect:SetColorRGB(r,
g, b) - Set to a specific RGB color.

ColorSelect:SetColorValueTexture(texture
or nil) - Set the texture used to show color value - New in 1.11.

ColorSelect:SetColorValueThumbTexture(texture
or "texture" or nil) - Set the texture for the color value thumb - New in
1.11.

ColorSelect:SetColorWheelTexture(texture
or nil) - Set the texture for the color wheel - New in 1.11.

ColorSelect:SetColorWheelThumbTexture(texture
or "texture" or nil) - Set the texture for the color wheel thumb - New in
1.11.

[edit]
EditBox

See EditBox object information
for details.

EditBox has all of the methods from UIObject, FontInstance, Region and Frame, plus the
following:

EditBox:AddHistoryLine("text")
- Add text to the edit history.

EditBox:ClearFocus()

EditBox:GetAltArrowKeyMode()
- Return whether only alt+arrow keys work for navigating the edit box, not
arrow keys alone.

EditBox:GetBlinkSpeed()
- Gets the blink speed of the EditBox in seconds - New in 1.11.

EditBox:GetHistoryLines()
- Get the number of history lines for this edit box

EditBox:GetInputLanguage()
- Get the input language (locale based not in-game)

EditBox:GetMaxBytes()
- Gets the maximum number bytes allowed in the EditBox - New in 1.11.

EditBox:GetMaxLetters()
- Gets the maximum number of letters allowed in the EditBox - New in 1.11.

EditBox:GetNumLetters()
- Gets the number of letters in the box.

EditBox:GetNumber()

EditBox:GetText() - Get
the current text contained in the edit box.

EditBox:GetTextInsets()
- Gets the text display insets for the EditBox - New in 1.11.

EditBox:HighlightText([startPos,
endPos]) - Set the highlight to all or some of the edit box text.

EditBox:Insert("text")
- Insert text into the edit box.

EditBox:IsAutoFocus()
- Determine if the EditBox has autofocus enabled - New in 1.11.

EditBox:IsMultiLine()
- Determine if the EditBox accepts multiple lines - New in 1.11.

EditBox:IsNumeric()
- Determine if the EditBox only accepts numeric input - New in 1.11.

EditBox:IsPassword()
- Determine if the EditBox performs password masking - New in 1.11.

EditBox:SetAltArrowKeyMode(enable)
- Make only alt+arrow keys work for navigating the edit box, not arrow keys
alone.

EditBox:SetAutoFocus(state)
- Set whether or not the editbox will attempt to get input focus when it gets
shown (default: yes) - New in 1.11.

EditBox:SetBlinkSpeed

EditBox:SetFocus()
- Move input focus (the cursor) to this editbox

EditBox:SetHistoryLines()
- Set the number of history lines to remember.

EditBox:SetMaxBytes(maxBytes)
- Set the maximum byte size for entered text.

EditBox:SetMaxLetters(maxLetters)
- Set the maximum number of letters for entered text.

EditBox:SetMultiLine(state)
- Set the EditBox's multi-line state - New in 1.11.

EditBox:SetNumber(number)

EditBox:SetNumeric(state)
- Set if the EditBox only accepts numeric input - New in 1.11.

EditBox:SetPassword(state)
- Set the EditBox's password masking state - New in 1.11.

EditBox:SetText("text")
- Set the text contained in the edit box.

EditBox:SetTextInsets(l,
r, t, b)

EditBox:ToggleInputLanguage()

[edit]
GameTooltip

The tooltip automatically resizes itself when its Show() method is called.
See GameTooltip object
information for details.

GameTooltip has all of the methods from UIObject, Region and Frame, plus the following:

GameTooltip:AddDoubleLine(textL,
textR, rL, gL, bL, rR, gR, bR)

GameTooltip:AddFontStrings(leftstring,
rightstring) - Dynamically expands the size of a tooltip - New in 1.11.

GameTooltip:AddLine

GameTooltip:AppendText("text")
- Append text to the end of the first line of the tooltip.

GameTooltip:ClearLines

GameTooltip:FadeOut

GameTooltip:GetAnchorType()
- Returns the current anchoring type.

GameTooltip:IsOwned(frame)
- Returns true if the tooltip is currently owned by the specified frame -
Since 1.8.

GameTooltip:NumLines()
- Get the number of lines in the tooltip.

GameTooltip:SetAction(slot)
- Shows the tooltip for the specified action button.

GameTooltip:SetAuctionCompareItem("type",
index[, offset])

GameTooltip:SetAuctionItem("type",
index) - Shows the tooltip for the specified auction item.

GameTooltip:SetAuctionSellItem

GameTooltip:SetBagItem(bag,
slot)

GameTooltip:SetBuybackItem

GameTooltip:SetCraftItem

GameTooltip:SetCraftSpell

GameTooltip:SetHyperlink(("itemString"
or "itemLink")) - Changes the item which is displayed in the tooltip according
to the passed argument.

GameTooltip:SetInboxItem(index)
- Shows the tooltip for the specified mail inbox item.

GameTooltip:SetInventoryItem(unit,
slot[, nameOnly])

GameTooltip:SetLootItem

GameTooltip:SetLootRollItem(id)
- Shows the tooltip for the specified loot roll item.

GameTooltip:SetMerchantCompareItem("slot"[,
offset])

GameTooltip:SetMerchantItem

GameTooltip:SetMinimumWidth(width)
- (Formerly SetMoneyWidth)

GameTooltip:SetOwner(owner,
"anchor"[, +x, +y])

GameTooltip:SetPadding

GameTooltip:SetPetAction(slot)
- Shows the tooltip for the specified pet action.

GameTooltip:SetPlayerBuff(buffIndex)
- Direct the tooltip to show information about a player's buff.

GameTooltip:SetQuestItem

GameTooltip:SetQuestLogItem

GameTooltip:SetQuestLogRewardSpell

GameTooltip:SetQuestRewardSpell

GameTooltip:SetSendMailItem

GameTooltip:SetShapeshift(slot)
- Shows the tooltip for the specified shapeshift form.

GameTooltip:SetSpell(spellId,
bookType) - Shows the tooltip for the specified spell.

GameTooltip:SetTalent(tabIndex,
talentIndex) - Shows the tooltip for the specified talent.

GameTooltip:SetText("text",
r, g, b[, alphaValue[, textWrap]]) - Set the text of the tooltip.

GameTooltip:SetTrackingSpell

GameTooltip:SetTradePlayerItem

GameTooltip:SetTradeSkillItem

GameTooltip:SetTradeTargetItem

GameTooltip:SetTrainerService

GameTooltip:SetUnit

GameTooltip:SetUnitBuff("unitId", buffIndex[,
raidFilter]) - Shows the tooltip for a unit's buff.

GameTooltip:SetUnitDebuff("unitId", buffIndex[,
raidFilter]) - Shows the tooltip for a unit's debuff.

[edit]
MessageFrame

See MessageFrame
object information for details.

MessageFrame has all of the methods from UIObject, FontInstance, Region and Frame, plus the
following:

MessageFrame:AddMessage("text",
r, g, b, a, holdTime) - Add a message to the frame which will fade eventually.

MessageFrame:Clear()
- Clear the messages from the frame - New in 1.11.

MessageFrame:GetFadeDuration()
- Gets the fade duration in seconds - New in 1.11.

MessageFrame:GetFading()
- Get whether the frame is fading - New in 1.11.

MessageFrame:GetInsertMode()
- Get the insert mode for the frame - New in 1.11.

MessageFrame:GetTimeVisible()
- Get the message visibility time in seconds - New in 1.11.

MessageFrame:SetFadeDuration(seconds)
- Set the fade duration - New in 1.11.

MessageFrame:SetFading(status)
- Set whether the frame fades messages - New in 1.11.

MessageFrame:SetInsertMode("TOP"
or "BOTTOM") - Set where new messages are inserted - New in 1.11.

MessageFrame:SetTimeVisible(seconds)
- Sets the message visibility time - New in 1.11.

[edit]
Minimap

See Minimap
object information for details

Note: Tracking dots malfunction if you have multiple instances of this
widget that are different sizes/zooms.

Minimap has all of the methods from UIObject, Region and Frame, plus the following:

Minimap:GetPingPosition()
- Get the last ping location.

Minimap:GetZoom() - Get
the current zoom level.

Minimap:GetZoomLevels()
- Get the maximum zoom level.

Minimap:PingLocation(x,
y) - Perform a ping at the specified location.

Minimap:SetArrowModel("file")
- Set the file to use for the arrow model - New in 1.11.

Minimap:SetBlipTexture
- Set the file to use for blips (ObjectIcons)

Minimap:SetIconTexture

Minimap:SetMaskTexture

Minimap:SetPlayerModel("file")
- Set the file to use for the player model - New in 1.11.

Minimap:SetZoom(level)
- Set the current zoom level.

[edit]
Model

Used to display real 3D-mesh geometry as part of the UI. See Model
object information for details.

Model has all of the methods from UIObject, Region and Frame, plus the following:

Model:AdvanceTime()

Model:ClearFog()
- Removes all fogging effects currently active in rendering.

Model:ClearModel()
- Removes all geometry from the Model (i.e. makes it empty)

Model:GetFacing() -
Returns the direction the model is facing.

Model:GetFogColor()
- Gets the fog color (r, g, b, a) - New in 1.11.

Model:GetFogFar()
- Gets the fog far distance - New in 1.11.

Model:GetFogNear()
- Gets the fog near distance - New in 1.11.

Model:GetLight()
- Gets the light specification for the model, returns a list of results
compatible with the SetLight method - New in 1.11.

Model:GetModel()
- Gets the model file for this Model - New in 1.11.

Model:GetModelScale()
- Returns the current mesh scaling factor.

Model:GetPosition() -
Returns the current position of the mesh as x, y, z

Model:ReplaceIconTexture("texture")

Model:SetCamera(index) -
Select a pre-defined camera.

Model:SetFacing(facing)
- Set the direction that the model is facing.

Model:SetFogColor(r,
g, b[, a]) - Set the fog color and enable fogging.

Model:SetFogFar(value) -
Set the far-clipping plane distance for fogging.

Model:SetFogNear(value)
- Set the near-clipping plane distance for fogging.

Model:SetLight(enabled[,
omni, dirX, dirY, dirZ, ambIntensity[, ambR, ambG, ambB[, dirIntensity[, dirR,
dirG, dirB]]]]) - Place the light source used for rendering

Model:SetModel("file") -
Set the mesh that is displayed in the frame.

Model:SetModelScale(scale)
- Sets the scale factor for the mesh before rendering.

Model:SetPosition(x,
y, z) - Set the position of the mesh inside the frame's coordinate system.

Model:SetSequence(sequence)
- Set the animation to be played.

Model:SetSequenceTime(sequence,
time)

[edit]
ScrollFrame

See ScrollFrame object
information for details.

ScrollFrame has all of the methods from UIObject, Region and Frame, plus the following:

ScrollFrame:GetHorizontalScroll()

ScrollFrame:GetHorizontalScrollRange()

ScrollFrame:GetScrollChild

ScrollFrame:GetVerticalScroll()

ScrollFrame:GetVerticalScrollRange()

ScrollFrame:SetHorizontalScroll(offset)

ScrollFrame:SetScrollChild

ScrollFrame:SetVerticalScroll(offset)

ScrollFrame:UpdateScrollChildRect()

[edit]
ScrollingMessageFrame

See ScrollingMessageFrame
object information for details.

ScrollingMessageFrame has all of the methods from UIObject, FontInstance, Region and Frame, plus the
following:

ScrollingMessageFrame:AddMessage("text"[,
r, g, b[, id]]) - Add a message to the frame, with an optional color ID.

ScrollingMessageFrame:AtBottom()
- Test whether frame is at the bottom.

ScrollingMessageFrame:AtTop()
- Test whether frame is at the top - New in 1.11.

ScrollingMessageFrame:Clear()
- Clear all lines from the frame.

ScrollingMessageFrame:GetCurrentLine()
- Returns the line number that was printed last, starting from 0.

ScrollingMessageFrame:GetCurrentScroll()
-- Returns the amount of messages from the end message (GetNumMessages()) that
the user has scrolled.

ScrollingMessageFrame:GetFadeDuration

ScrollingMessageFrame:GetFading

ScrollingMessageFrame:GetMaxLines()
- Get the maximum number of lines the frame can display.

ScrollingMessageFrame:GetNumLinesDisplayed()

ScrollingMessageFrame:GetNumMessages()

ScrollingMessageFrame:GetTimeVisible

ScrollingMessageFrame:PageDown()

ScrollingMessageFrame:PageUp()

ScrollingMessageFrame:ScrollDown()

ScrollingMessageFrame:ScrollToBottom()

ScrollingMessageFrame:ScrollToTop()

ScrollingMessageFrame:ScrollUp()

ScrollingMessageFrame:SetFadeDuration(seconds)
- Set the fade duration.

ScrollingMessageFrame:SetFading([isEnabled])
- Set whether fading is enabled - Renamed in 1.11.

ScrollingMessageFrame:SetMaxLines(lines)
- Set the maximum number of displayed lines. Tested successfully with values
up to a million. Resets the messages already within the frame.

ScrollingMessageFrame:SetScrollFromBottom

ScrollingMessageFrame:SetTimeVisible(seconds)
- Sets how long lines remain visible.

ScrollingMessageFrame:UpdateColorByID(id,
r, g, b)

[edit]
SimpleHTML

See SimpleHTML object
information for details.

SimpleHTML has all of the methods from UIObject, Region and Frame, plus the following:

SimpleHTML appears to have all the methods of FontInstance, and they
can indeed be used in the same way to set the default font, but they all have an
optional first parameter for which element's font to set ("h1", "h2", "p", etc).
The Font instance methods are not reflected in the SimpleHTML frame until you
SetText on the frame. It also appears that you can only supply the block
elements and not the inline elements (ie Hyperlinks cannot be colored a
different color). Other than that, see FontInstance for documentation of these
methods.

SimpleHTML:GetFont(["element"])

SimpleHTML:GetFontObject(["element"])

SimpleHTML:GetHyperlinkFormat()
- Set the string.format format to use for displaying hyperlinks - New in 1.11.

SimpleHTML:GetJustifyH(["element"])

SimpleHTML:GetJustifyV(["element"])

SimpleHTML:GetShadowColor(["element"])

SimpleHTML:GetShadowOffset(["element"])

SimpleHTML:GetSpacing(["element"])

SimpleHTML:GetTextColor(["element"])

SimpleHTML:SetFont(["element",]
"path", height[,"flags"])

SimpleHTML:SetFontObject(["element",]
fontObject)

SimpleHTML:SetHyperlinkFormat("format")
- Set the string.format format to use for displaying hyperlinks.

SimpleHTML:SetJustifyH(["element",]
"justifyH")

SimpleHTML:SetJustifyV(["element",]
"justifyV")

SimpleHTML:SetShadowColor(["element",]
r, g, b[, a])

SimpleHTML:SetShadowOffset(["element",]
x, y)

SimpleHTML:SetSpacing(["element",]
lineSpacing)

SimpleHTML:SetText("text")
- Set the HTML markup to be displayed (note: if there is any markup
error, it will be displayed as plain text)

SimpleHTML:SetTextColor(["element",]
r, g, b[, a])

[edit]
Slider

See Slider
object information for details.

Slider has all of the methods from UIObject, Region and Frame, plus the following:

Slider:GetMinMaxValues()
- Get the current bounds of the slider.

Slider:GetOrientation()
- Returns "HORIZONTAL" or "VERTICAL".

Slider:GetThumbTexture()
- Get the texture for this slider's thumb - New in 1.11.

Slider:GetValue()
- Get the current value of the slider.

Slider:GetValueStep()
- Get the current step size of the slider.

Slider:SetMinMaxValues(min,
max) - Set the bounds of the slider.

Slider:SetOrientation("orientation")
- "HORIZONTAL" or "VERTICAL".

Slider:SetThumbTexture(texture
or "texturePath")

Slider:SetValue(value)
- Set the value of the slider. Also causes the thumb to show on the first
call.

Slider:SetValueStep(value)
- Set the step size of the slider.

[edit]
StatusBar

See StatusBar
object information for details.

StatusBar has all of the methods from UIObject, Region and Frame, plus the following:

StatusBar:GetMinMaxValues()
- Get the current bounds of the bar.

StatusBar:GetOrientation

StatusBar:GetStatusBarColor

StatusBar:GetStatusBarTexture()
- Returns the texture object for the bar - Before 1.11 it returned the
filename.

StatusBar:GetValue()
- Get the current value of the bar.

StatusBar:SetMinMaxValues(min,
max) - Set the bounds of the bar.

StatusBar:SetOrientation

StatusBar:SetStatusBarColor(r,
g, b[, alpha]) - Set the color of the bar.

StatusBar:SetStatusBarTexture("file"
or texture[,"layer"]) - Sets the texture of the bar - Added texture as valid
arg in 1.11.

StatusBar:SetValue(value)
- Set the value of the bar.

[edit]
Button Derivatives

[edit]
CheckButton

See CheckButton
object information for details.

CheckButton has all of the methods from UIObject, Region, Frame and Button, plus the following:

CheckButton:GetChecked()
- Get the status of the checkbox.

CheckButton:GetCheckedTexture()
- Get the texture used for a checked box - New in 1.11.

CheckButton:GetDisabledCheckedTexture()
- Get the texture used for a disabled checked box - New in 1.11.

CheckButton:SetChecked([state])
- Set the status of the checkbox.

CheckButton:SetCheckedTexture(texture)
- Set the texture to use for a checked box.

CheckButton:SetDisabledCheckedTexture(texture)
- Set the texture to use for a disabled but checked box.

[edit]
LootButton

(See LootButton
object information for details) LootButton has all of the methods from UIObject, Region, Frame and Button, plus the following:

LootButton:SetSlot(index)
- Set which the item to loot if the button is clicked.

[edit]
Model Derivatives

[edit]
PlayerModel

See PlayerModel
object information for details.

PlayerModel has all of the methods from UIObject, Region, Frame and Model, plus the following:

PlayerModel:RefreshUnit()

PlayerModel:SetRotation(rotationRadians)

PlayerModel:SetUnit("unitId")

[edit]
PlayerModel Derivatives

[edit]
DressUpModel

See DressUpModel
object information for details.

DressUpModel has all of the methods from UIObject, Region, Frame, Model and PlayerModel, plus the
following:

DressUpModel:Dress()
- Set the model to reflect the character's current inventory.

DressUpModel:TryOn("item")
- Add the specified item to the model.

DressUpModel:Undress()
- Set the model to reflect the character without inventory.

[edit]
TabardModel

See TabardModel
object information for details.

TabardModel has all of the methods from UIObject, Region, Frame, Model and PlayerModel, plus the
following:

TabardModel:CanSaveTabardNow()
- Indicate if the tabard can be saved.

TabardModel:CycleVariation(variationIndex,
delta)

TabardModel:GetLowerBackgroundFileName

TabardModel:GetLowerEmblemFileName

TabardModel:GetLowerEmblemTexture("textureName")

TabardModel:GetUpperBackgroundFileName

TabardModel:GetUpperEmblemFileName

TabardModel:GetUpperEmblemTexture("textureName")

TabardModel:InitializeTabardColors()

TabardModel:Save()
- Save the tabard.

[edit]
LayeredRegion Derivatives

[edit]
Texture

See Texture
object information for details.

Texture has all of the methods from UIObject, Region and LayeredRegion, plus
the following:

Texture:GetBlendMode()
- Return the blend mode set by SetBlendMode()

Texture:GetTexCoord()
- Gets the 8 texture coordinates that map to the Texture's corners - New in
1.11.

Texture:GetTexCoordModifiesRect()
- Get the SetTexCoordModifiesRect setting - New in 1.11

Texture:GetTexture()
- Gets this texture's current texture path.

Texture:GetVertexColor()
- Gets the vertex color for the Texture.

Texture:IsDesaturated()
- Gets the desaturation state of this Texture. - New in 1.11

Texture:SetBlendMode("mode")
- Set the alphaMode of the texture.

Texture:SetDesaturated(flag)
- Set whether this texture should be displayed with no saturation
(Note: This has a return value)

Texture:SetGradient("orientation",
minR, minG, minB, maxR, maxG, maxB)

Texture:SetGradientAlpha("orientation",
minR, minG, minB, minA, maxR, maxG, maxB, maxA)

Texture:SetTexCoord(minX,
maxX, minY, maxY or ULx, ULy, LLx, LLy, URx, URy, LRx, LRy) - Set the corner
coordinates for texture display.

Texture:SetTexCoordModifiesRect(enableFlag)
- Set whether future SetTexCoord operations should modify the display
rectangle rather than stretch the texture. - New in 1.11

Texture:SetTexture("texturePath"
or r, g, b[, a]) - Sets the texture to be displayed from a file or to a solid
color.

[edit]
FontString

See FontString object
information for details.

FontString has all of the methods from UIObject, FontInstance, Region and LayeredRegion, plus
the following:

Note that FontString:Get/SetWidth() and Get/SetHeight() behave very
differently for fontstrings; see the object information.

FontString:CanNonSpaceWrap()
- Get whether long strings without spaces are wrapped or truncated - New in
1.11.

FontString:GetStringWidth()
- Returns the width in pixels of the current string in the current font
(without line wrapping).

FontString:GetText()
- Get the displayed text.

FontString:SetAlphaGradient(start,
length) - Create or remove an alpha gradient over the text.

FontString:SetNonSpaceWrap(wrapFlag)
- Set whether long strings without spaces are wrapped or truncated.

FontString:SetText("text")
- Set the displayed text.

FontString:SetTextHeight(pixelHeight)
- Set the height of the text by scaling graphics (Note: Can distort text).

[edit]
Special

[edit]
WorldFrame

WorldFrame is the frame which is used to display 3D world itself. It can be
resized or hidden, but that is highly risky (especially hide). There can only be
one WorldFrame frame at a time. It is unknown if this frame has special methods
besides ones inherited from Frame widget. It is THE MOST important frame that is
used in WoW, so don't try messing with it!

[edit]
Secure Frames

Secure Frames are special frames that can be used to execute protected
functions without being blocked by the UI. Because of their special
capabilities, all Secure Frames require a special treatment in order to work
correctly, particularly with regard to Script-handling.

All Secure Frames are defined in the SecureTemplates.XML and are derivatives
of SecureFrameTemplate.
They were introduced with patch 2.0.

SecureActionButtonTemplate
- Very versatile button used for all kinds of click-cast style action

SecureUnitButtonTemplate
- A variant of SecureActionButtonTemplate
used for unit buttons

SecureStateHeaderTemplate
- Basic template for powerful state-based actions

SecureStateDriverTemplate
- Variant of the SecureStateHeaderTemplate
especially for stance/shapeshift/actionbar changes

SecureAnchorButtonTemplate
- Click-trigger for drop down and pop up uses

SecureAnchorEnterTemplate
- Mouseover-trigger for drop down and pop up uses

SecureAnchorUpDownTemplate
- MouseUp/Down-trigger for drop down and pop up uses

SecurePieButtonTemplate
- Used for creating radial menus

SecurePartyHeaderTemplate
- Used for managing party members

SecureRaidGroupHeaderTemplate
- Used for managing raid members

[edit]
Drop Down Menus

Drop down menus do not follow the current widget class format and, in most
cases, do not inherit even a small percentage of the frame class. Provided is a
guide on how to implement Drop Down Menus.

UIDropDownMenu -
The base class for Drop Down Menus

Retrieved from "http://www.wowwiki.com/Widget_API"

Category: Widgets

Views

Article

Discussion

Edit
this page

History

Personal tools

Sign
in / create account

Navigation

Main Page

Village pump

Warcraft pump

Recent changes

Community portal

IRC
channel info

Random
page

Search
WoWWiki

Help

Google Ads

Popular Pages

Burning
Crusade

Karazhan

Aldor v
Scryer

Jewelcrafting

Instance guides

Armor sets

Fansites

Patch
mirrors

Search

Web

wowwiki

Toolbox

What links
here

Related
changes

Upload
file

Special pages

Printable
version

Permanent
link

This page was last modified 11:27, 2 May 2007.

This page has been accessed 111,498 times.     Best
viewed under IE7 or Firefox 2 and higher.     Jump to the top ↑

Content is available under GNU Free
Documentation License 1.2.

Privacy policy

About WoWWiki

Disclaimers