WoW:API Region IsShown: Difference between revisions

m
Move page script moved page API Region IsShown to WoW:API Region IsShown without leaving a redirect
No edit summary
m (Move page script moved page API Region IsShown to WoW:API Region IsShown without leaving a redirect)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
If a parent of a frame calls Hide(), then all of it's children are hidden. In this case, it's children are "visible", but not "shown".
{{widgetmethod}}
Determine if the object would be visible if its parent was visible.


The default UI uses this in a couple of places to tell whether or not the entire UI has been hidden for screenshot purposes (visible is true, but shown isn't)
shown = MyObject:IsShown();


{{template:WoW API}}
== Returns ==
 
:;shown: [[boolean]] - true if the object will be visible when its parent is visible.
 
== Example ==
if MyFrame:IsShown() and not MyFrame:IsVisible() then
    -- Frame is "shown", but not visible (one or more of its parents isn't shown)
elseif MyFrame:IsVisible() then
    -- Frame is visible on-screen!
end
 
== Details ==
 
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 ''nil''.
 
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.
 
== Notes ==
* Prior to patch 1.9, FontStrings did not have an :IsShown(). They did have an :IsVisible() method with the behaviour of :IsShown().
 
== See also ==
* {{api|Region:IsVisible|t=w}}
Anonymous user