WoW:API Region GetHeight: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Changing Aerobrain to Omnigrok (user switched handles))
(Put both GetHeight / GetWidth documentation here.)
Line 1: Line 1:
<center>'''GetHeight''' ''-Documentation by [[User:Omnigrok|Omnigrok]]-''</center>
{{widgetmethod}} __NOTOC__


Gets the height of a frame-based object.
Gets the height and width, respectively, of an object.


  height = <i>FrameLayout</i>:GetHeight();
  dimension = MyObject:GetWidth();
dimension = MyObject:GetHeight();


----
== Returns ==
;''Arguments''
:;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 [[API Region SetHeight|:SetHeight]]() / [[API Region SetHeight|:SetWidth]](), or the actual height/width used if computed from two or more [[API Region SetPoint|:SetPoint]]() calls.


:<i>none</i>
== Example ==
 
----
;''Returns''
 
: height
:; height : Number - The height of the frame-based object (This is the desired height, if set with SetHeight, or the actual height if no desired height has been provided)
 
----
;''Example''
  myAddonOptionsParent = myAddonOptions:GetParent();
  myAddonOptionsParent = myAddonOptions:GetParent();
  myAddonOptions:SetHeight(''myAddonOptionsParent:GetHeight()'' / 2);
  myAddonOptions:SetWidth('''myAddonOptionsParent:GetWidth()''' / 2);


;''Result''
=== Result ===
: The frame named 'myAddonOptions' would be set to half the height of its parent frame.
: The frame named "myAddonOptions" would be set to half the width of its parent frame.


== Notes ==


----
Note that even though [[UIOBJECT FontString|FontString]] has GetWidth()/GetHeight() methods, they behave very differently and have potentially very little to do with the displayed dimension.
{{WoW API}}

Revision as of 15:30, 29 July 2006

Widget API ← Region < GetHeight

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

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

Returns

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.

Example

myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetWidth(myAddonOptionsParent:GetWidth() / 2);

Result

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

Notes

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