Widget API: Region:GetHeight

Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API Region GetHeight to API Region GetHeight without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Widget API ← Region < GetHeight

Gets the height and width, respectively, of an object.

dimension = MyObject:GetWidth();
dimension = MyObject:GetHeight();

ParametersEdit

ArgumentsEdit

ReturnsEdit

  • dimension (number) - height/width of the object in pixels, in its own coordinate space (scaling dependent). This is the desired height/width, if set with :SetHeight() / :SetWidth(), or the actual height/width used if computed from two or more :SetPoint() calls.

ExampleEdit

myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetHeight(myAddonOptionsParent:GetHeight() / 2);

ResultEdit

The frame named "myAddonOptions" would be set to half the height of its parent frame.

NotesEdit

Note that even though FontString has GetWidth()/GetHeight() methods, they behave very differently and have potentially very little to do with the displayed dimension.