Functions Widget |
From WoWDev
Contents |
Widget API Methods
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 so there's a high degree of confidence the list is correct.
This list is current as of patch 1.9.0 (10900). -- Flickering 14:07, 11 Jan 2006 (PDT)
Root Widgets
LayoutFrame
(See LayoutFrame object information for details). This is an abstract frame type which cannot actually be created. It gathers together a number of common methods which have identical behaviours across all widget types.
- LayoutFrame:ClearAllPoints() - Clear all attachment points for this object.
- LayoutFrame:GetHeight() - Get the height of this object.
- LayoutFrame:GetName() - Get the name of this object.
- LayoutFrame:GetWidth() - Get the width of this object.
- LayoutFrame:Hide() - Set this object to hidden (it and all of its children will disappear).
- LayoutFrame:IsShown() - Determine if this string is shown (would be visible if its parent was visible) - New in 1.9.
- LayoutFrame:IsVisible() - Get whether the object is visible on screen (logically (IsShown() and GetParent():IsVisible()));
- LayoutFrame:SetAlpha(alpha) - Set the alpha level of this object (affects children also).
- LayoutFrame:SetHeight(height) - Set the height of the object.
- LayoutFrame:SetPoint("point","relativeFrame","relativePoint"[,xOfs,yOfs]) - Set an attachment point of this object.
- LayoutFrame:SetWidth(width) - Set the width of the object.
- LayoutFrame:Show() - Set this object to shown (it will appear if its parent is visible).
LayoutFrame Derivatives
FontString
(See FontString object information for details). Includes all of the methods from LayoutFrame, plus the following:
- FontString:GetFont() - Returns the font, size, and flags currently used for display. - New in 1.9.
- 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:GetTextColor() - Get the color of the displayed text.
- FontString:SetAlphaGradient(start,length) - Create or remove an alpha gradient over the text.
- FontString:SetFont("font",size[,"flags"]) - Set the font to use for display.
- FontString:SetJustifyH("direction") - Set the horizontal justification of this string.
- FontString:SetJustifyV("direction") - Set the vertical justification of this string.
- FontString:SetNonSpaceWrap(wrapFlag) - Set whether long strings without spaces are wrapped or truncated - New in 1.9.
- FontString:SetText("text") - Set the displayed text.
- FontString:SetTextColor(r,g,b[,alpha]) - Set the color of the text.
- FontString:SetTextHeight(pixelHeight) - Set the height of the text by scaling graphics (Note: Can distort text).
- FontString:SetVertexColor(r,g,b[,alpha])
Frame
(See Frame object information for details). Includes all of the methods from LayoutFrame, plus the following:
- Frame:DisableDrawLayer
- Frame:EnableDrawLayer
- Frame:EnableKeyboard(enableFlag) - Set whether this frame will get keyboard input.
- Frame:EnableMouse(enableFlag) - Set whether this frame will get mouse input.
- Frame:EnableMouseWheel(enableFlag) - Set whether this frame will get mouse wheel events.
- Frame:GetAlpha() - Get the alpha level of this frame.
- Frame:GetBottom() - Get the y location of the bottom edge of this frame.
- Frame:GetCenter() - Get the coordinates of the center of this frame.
- Frame:GetChildren() - Get children of this frame.
- Frame:GetEffectiveScale() - Get the scale factor of this object relative to the root window - New in 1.9.
- Frame:GetFrameLevel() - Get the level of this frame.
- Frame:GetFrameStrata() - Get the strata of this frame.
- Frame:GetFrameType() - Get the type of this frame - New in 1.9.
- Frame:GetID() - Get the ID of this frame.
- Frame:GetLeft() - Get the x location of the left edge of this frame.
- Frame:GetNumChildren() - Get the number of children this frame has.
- Frame:GetParent() - Get the parent of this frame (The object, not just the name).
- Frame:GetRight() - Get the x location of the right edge of this frame.
- Frame:GetScale() - Get the scale factor of this object relative to its parent. (Behaviour fixed in 1.9)
- Frame:GetScript("handler") - Get the function for one of this frame's handlers.
- Frame:GetTop() - Get the y location of the top edge of this frame.
- 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:IsFrameType("type") - Determine if this frame is of the specified type, or a subclass of that type - New in 1.9.
- Frame:IsMovable() - Determine if the frame can be moved.
- Frame:IsResizable() - Determine if the frame can be resized.
- 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: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:SetAllPoints("frame")
- 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: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: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:SetParent(parent or "parentName") - Set the parent for this frame.
- Frame:SetResizable(isResizable) - Set whether the frame can be resized.
- Frame:SetScale(scale) - Set the scale factor of this frame relative to its parent. (Behaviour updated in 1.9)
- Frame:SetScript("handler",function) - Set the function to use for a handler on this frame.
- 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.
Texture
(See Texture object information for details). Includes all of the methods from LayoutFrame, plus the following:
- Texture:GetAlpha() - Gets this texture's alpha level.
- Texture:GetTexture() - Gets this texture's current texture path - New in 1.9.
- Texture:SetDesaturated(flag) - Set whether this texture should be displayed with no saturation (IMPORTANT: 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 - Second usage new in 1.9.
- Texture:SetTexture("texturePath") - Sets the texture to be displayed
- Texture:SetVertexColor(r,g,b[,alpha])
FontString Derivatives
DisabledText
(See DisabledText object information for details). Includes all of the methods from FontString and LayoutFrame.
HighlightText
(See HighlightText object information for details). Includes all of the methods from FontString and LayoutFrame.
NormalText
(See NormalText object information for details). Includes all of the methods from FontString and LayoutFrame.
Frame Derivatives
Button
(See Button object information for details). Includes all of the methods from Frame and LayoutFrame, 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()
- Button:GetFont() - Returns the font, size, and flags currently used for display. - New in 1.9.
- Button:GetText()
- Button:GetTextHeight()
- Button:GetTextWidth()
- Button:IsEnabled() - Determine whether the button is enabled.
- Button:LockHighlight() - Set the button to always be drawn highlighted.
- Button:RegisterForClicks("clickType"[,"clickType"...]) - Indicate which types of clicks this button should receive.
- Button:SetButtonState("state",lock)
- Button:SetDisabledTextColor(r,g,b)
- Button:SetDisabledTexture("texture")
- Button:SetFont("font",size[,"flags"]) - Set the font to use for display - New in 1.9.
- Button:SetHighlightTextColor(r,g,b)
- Button:SetHighlightTexture("texture")
- Button:SetNormalTexture("texture")
- Button:SetPushedTexture("texture")
- Button:SetText("text")
- Button:SetTextColor(r,g,b)
- Button:UnlockHighlight() - Set the button to not always be drawn highlighted.
ColorSelect
(See ColorSelect object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- ColorSelect:GetColorHSV() - Get the HSV values of the selected color.
- ColorSelect:GetColorRGB() - Get the RGB values of the selected color.
- ColorSelect:SetColorHSV(h,s,v) - Set to a specific HSV color.
- ColorSelect:SetColorRGB(r,g,b) - Set to a specific RGB color.
EditBox
(See EditBox object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- EditBox:AddHistoryLine("text") - Add text to the edit history.
- EditBox:ClearFocus()
- EditBox:GetFont() - Returns the font, size, and flags currently used for display. - New in 1.9.
- EditBox:GetHistoryLines() - Get the number of history lines for this edit box
- EditBox:GetInputLanguage() - Get the input language (locale based not in-game)
- EditBox:GetNumLetters() - Gets the number of letters in the box.
- EditBox:GetNumber()
- EditBox:GetText() - Get the current text contained in the edit box.
- 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:SetFocus()
- EditBox:SetFont("font",size[,"flags"]) - Set the font to use for display - New in 1.9.
- EditBox:SetHistoryLines() - Set the number of history lines to remember.
- EditBox:SetIgnoreArrows([isIgnored])
- EditBox:SetMaxBytes(maxBytes) - Set the maximum byte size for entered text.
- EditBox:SetMaxLetters(maxLetters) - Set the maximum number of letters for entered text.
- EditBox:SetNumber(number)
- EditBox:SetText("text") - Set the text contained in the edit box.
- EditBox:SetTextColor(r,g,b) - Set the color of the text in the edit box.
- EditBox:SetTextInsets(l,r,t,b)
- EditBox:ToggleInputLanguage()
GameTooltip
(See GameTooltip object information for details). The tooltip automatically resizes itself when its Show() method is called. Includes all of the methods from Frame and LayoutFrame, plus the following:
- GameTooltip:AddDoubleLine(textL,textR,rL,gL,bL,rR,gR,bR)
- 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 - New in 1.9
- 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
- GameTooltip:SetBuybackItem
- GameTooltip:SetCraftItem
- GameTooltip:SetCraftSpell
- GameTooltip:SetHyperlink(link) - Shows the tooltip for the specified hyperlink (usually item link).
- 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
- 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,spellbookTabNum) - 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("unit",buffIndex[,raidFilter]) - Shows the tooltip for a unit's buff - raidFilter new in 1.9.
- GameTooltip:SetUnitDebuff("unit"buffIndex[,raidFilter]) - Shows the tooltip for a unit's debuff - raidFilter new in 1.9.
MessageFrame
(See MessageFrame object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- MessageFrame:AddMessage("text",r,g,b,a,holdTime) - Add a message to the frame which will fade eventually.
Minimap
(See Minimap object information for details). Tracking dots malfunction if you have multiple instances of this widget that are different sizes/zooms. Includes all of the methods from Frame and LayoutFrame, 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:SetZoom(level) - Set the current zoom level.
Model
(See Model object information for details). Used to display real 3D-mesh geometry as part of the UI. Includes all of the methods from Frame and LayoutFrame, 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:GetModelScale() - Returns the current mesh scaling factor (Formerly Model:GetScale()?) - New in 1.9.
- Model:GetPosition() - Returns the current position of the mesh as x,y,z
- Model:ReplaceIconTexture("texture")
- Model:SetCamera(index)
- 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 (Formerly Model:SetScale(scale)) - New in 1.9.
- 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)
MovieFrame
(See MovieFrame object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
ScrollFrame
(See ScrollFrame object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- ScrollFrame:GetHorizontalScroll()
- ScrollFrame:GetHorizontalScrollRange()
- ScrollFrame:GetVerticalScroll()
- ScrollFrame:GetVerticalScrollRange()
- ScrollFrame:SetHorizontalScroll(offset)
- ScrollFrame:SetVerticalScroll(offset)
- ScrollFrame:UpdateScrollChildRect()
ScrollingMessageFrame
(See ScrollingMessageFrame object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- ScrollingMessageFrame:AddMessage("text"[,r,g,b[,id]]) - Add a message to the frame, with an optional color ID.
- ScrollingMessageFrame:AtBottom() - Return true if frame is at the bottom.
- ScrollingMessageFrame:Clear() - Clear all lines from the frame.
- ScrollingMessageFrame:EnableFading([isEnabled]) - Set whether fading is enabled .
- ScrollingMessageFrame:GetCurrentLine()
- ScrollingMessageFrame:GetCurrentScroll()
- ScrollingMessageFrame:GetFont() - Returns the font, size, and flags currently used for display. - New in 1.9.
- ScrollingMessageFrame:GetFontHeight() - Get the current font height.
- ScrollingMessageFrame:GetMaxLines() - Get the maximum number of lines the frame can display.
- ScrollingMessageFrame:GetNumLinesDisplayed()
- ScrollingMessageFrame:GetNumMessages()
- ScrollingMessageFrame:PageDown()
- ScrollingMessageFrame:PageUp()
- ScrollingMessageFrame:ScrollDown()
- ScrollingMessageFrame:ScrollToBottom()
- ScrollingMessageFrame:ScrollToTop()
- ScrollingMessageFrame:ScrollUp()
- ScrollingMessageFrame:SetFadeDuration(seconds) - Set the fade duration.
- ScrollingMessageFrame:SetFont("font",size[,"flags"]) - Set the font to use for display - New in 1.9.
- ScrollingMessageFrame:SetFontHeight(pixelHeight)
- ScrollingMessageFrame:SetMaxLines(lines) - Set the maximum number of displayed lines.
- ScrollingMessageFrame:SetScrollFromBottom
- ScrollingMessageFrame:SetTimeVisible(seconds) - Sets how long lines remain visible.
- ScrollingMessageFrame:UpdateColorByID(id,r,g,b)
SimpleHTML
(See SimpleHTML object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- SimpleHTML:SetHyperlinkFormat("format") - Set the string.format format to use to display hyperlinks.
- SimpleHTML:SetText("text") - Set the text to be displayed.
- SimpleHTML:SetTextColor(r,g,b) - Set the color of displayed text.
Slider
(See Slider object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- Slider:GetMinMaxValues() - Get the current bounds of the slider.
- 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:SetValue(value) - Set the value of the slider.
- Slider:SetValueStep(value) - Set the step size of the slider.
StatusBar
(See StatusBar object information for details). Includes all of the methods from Frame and LayoutFrame, plus the following:
- StatusBar:GetMinMaxValues() - Get the current bounds of the bar.
- StatusBar:GetValue() - Get the current value of the bar.
- StatusBar:SetMinMaxValues(min,max) - Set the bounds of the bar.
- StatusBar:SetStatusBarColor(r,g,b[,alpha]) - Set the color of the bar.
- StatusBar:SetStatusBarTexture("file"[,"layer"]) - Sets the texture of the bar.
- StatusBar:SetValue(value) - Set the value of the bar.
TaxiRouteFrame
(See TaxiRouteFrame object information for details). You are only allowed a single instance of this widget. Includes all of the methods from Frame and LayoutFrame.
WorldFrame
(See WorldFrame object information for details). You are only allowed a single instance of this widget. Includes all of the methods from Frame and LayoutFrame.
Button Derivatives
CheckButton
(See CheckButton object information for details). Includes all of the methods from Button, Frame and LayoutFrame, plus the following:
- CheckButton:GetChecked() - Get the status of the checkbox.
- 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 an unchecked box.
LootButton
(See LootButton object information for details). Includes all of the methods from Button, Frame and LayoutFrame, plus the following:
- LootButton:SetSlot(index) - Set which the item to loot if the button is clicked.
Model Derivatives
PlayerModel
(See PlayerModel object information for details). Includes all of the methods from Model, Frame and LayoutFrame, plus the following:
PlayerModel Derivatives
DressUpModel
(See DressUpModel object information for details). Includes all of the methods from PlayerModel, Model, Frame and LayoutFrame, 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.
TabardModel
(See TabardModel object information for details). Includes all of the methods from PlayerModel, Model, Frame and LayoutFrame, 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.
Texture Derivatives
BarTexture
(See BarTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
CheckedTexture
(See CheckedTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
ColorWheelTexture
(See ColorWheelTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
DisabledTexture
(See DisabledTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
HighlightTexture
(See HighlightTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
NormalTexture
(See NormalTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
PushedTexture
(See PushedTexture object information for details). Includes all of the methods from Texture and LayoutFrame.
ThumbTexture
(See ThumbTexture object information for details). Includes all of the methods from Texture and LayoutFrame.

