WoW:API Region SetPoint

From AddOn Studio
Revision as of 06:04, 8 November 2005 by WoWWiki>Jbcc (updated argument list and listed defaults for arguments that are not specified)
Jump to navigation Jump to search
SetPoint -Documentation by Sarf-

Sets the current attachment point of an UI component. Any of the following formats are valid

obj:SetPoint(point);
obj:SetPoint(point, frame);
obj:SetPoint(point, frame, relativePoint);
obj:SetPoint(point, x, y);
obj:SetPoint(point, frame, relativePoint , x, y);



Arguments
point
the point to attach the obj to (see API Positions) (i.e. bind the left side of your frame)
frame
the name of the frame to attach the obj to, an actual frame variable can also be used (can be "UIParent" to attach it to the screen itself)
defaults to the parent of obj when not specified
relativePoint
the relative point to attach the obj to (see API Positions) (i.e. bind your frame to the left side of the parent)
defaults to the value of point when not specified
x
the X offset (-5 means 5 units left, 5 means 5 units right)
defaults to 0 when not specified
y
the Y offset (-5 means 5 units down, 5 means 5 units up)
defaults to 0 when not specified

Returns
nil

Examples

The following are all equivalent.

MainMenuBar:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT", 0, 0);
MainMenuBar:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 0, 0);
MainMenuBar:SetPoint("BOTTOMLEFT", "UIParent", "BOTTOMLEFT");
MainMenuBar:SetPoint("BOTTOMLEFT", "UIParent");

The following is equivalent to the above, given that the parent frame of MainMenuBar is UIParent.

MainMenuBar:SetPoint("BOTTOMLEFT");
MainMenuBar:SetPoint("BOTTOMLEFT", 0, 0);
Result

Description
Attaches obj to the specified position.

Template:WoW API