WoW:API Region IsShown: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
No edit summary
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".
<center>'''IsShown'''</center>


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)
Determine if the object is shown (would be visible if its parent was visible).


{{template:WoW API}}
LayoutFrame:IsShown();
 
----
;''Arguments''
 
:;nil
 
----
;''Returns''
 
: Boolean
 
----
;''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 both shown and all it's parents are shown aswell
end
 
----
;''Description''
 
: Gets the shown state of an object.
 
:Calling Show() will make subsequent calls to IsShown() return true, likewise, calling Hide() will make subsequent calls to IsShown() return false.
: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()]].
----
{{Template:WoW API}}

Revision as of 04:20, 31 January 2006

IsShown

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

LayoutFrame:IsShown();

Arguments
nil

Returns
Boolean

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 both shown and all it's parents are shown aswell
end

Description
Gets the shown state of an object.
Calling Show() will make subsequent calls to IsShown() return true, likewise, calling Hide() will make subsequent calls to IsShown() return false.
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 LayoutFrame:IsVisible().

Template:WoW API