WoW:API Region IsShown: Difference between revisions

Link Boolean
No edit summary
(Link Boolean)
Line 1: Line 1:
  <center>'''IsShown'''</center>
{{widgetmethod}} __NOTOC__


Determine if the object is shown (would be visible if its parent was visible).
Determine if the object is "shown" (would be visible if its parent was visible).


  LayoutFrame:IsShown();
  shown = MyObject:IsShown();


----
== Returns ==
;''Arguments''


:;nil
:;shown: [[Boolean]] - true if the object will be visible when its parent is visible.


----
== Example ==
;''Returns''
 
: Boolean
 
----
;''Example''
  if MyFrame:IsShown() and not MyFrame:IsVisible() then
  if MyFrame:IsShown() and not MyFrame:IsVisible() then
     -- Frame is shown, but not visible (one or more of its parents isn't shown)
     -- Frame is "shown", but not visible (one or more of its parents isn't shown)
  elseif MyFrame:IsVisible() then
  elseif MyFrame:IsVisible() then
     -- Frame is both shown and all it's parents are shown aswell
     -- Frame is visible on-screen!
  end
  end


----
== Details ==
;''Description''
 
:Calling [[API Region Show|:Show]]() on an object will make subsequent calls to IsShown() return ''true''. Likewise, calling [[API Region Hide|:Hide]]() will make subsequent calls to IsShown() return ''false''.


: Gets the shown state of an object.
{{spc}}
:When an object is initialized, the return value of IsShown() is determined by the XML-attribute "hidden" for the object.
:Objects created via [[API CreateFrame|CreateFrame]](), [[API Frame CreateFontString|Frame:CreateFontString]]() or [[API Frame CreateTexture|Frame:CreateTexture]]() are initially created shown.


:Calling Show() will make subsequent calls to IsShown() return true, likewise, calling Hide() will make subsequent calls to IsShown() return false.
== History ==
:When the frame is initialized, the return value of IsShown() is determined by the XML-attribute "hidden" for the object.


:Note: in patch 1.9 this method was added to FontStrings aswell, which previously only had an IsVisible() method with the behaviour of IsShown(). The patch changed the behavior of FontString:IsVisible() to be the same as [[API LayoutFrame IsVisible|LayoutFrame:IsVisible()]].
:Prior to patch 1.9, FontStrings did not have an :IsShown(). They did have an :IsVisible() method with the behaviour of :IsShown().
----
{{Template:WoW API}}
Anonymous user