WoW:API Region IsShown: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Link Boolean) |
||
Line 1: | Line 1: | ||
{{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). | ||
shown = MyObject:IsShown(); | |||
== Returns == | |||
:; | :;shown: [[Boolean]] - true if the object will be visible when its parent is visible. | ||
== 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 | -- Frame is visible on-screen! | ||
end | 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 ''false''. | |||
: | {{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. | |||
== History == | |||
: | :Prior to patch 1.9, FontStrings did not have an :IsShown(). They did have an :IsVisible() method with the behaviour of :IsShown(). | ||
Revision as of 15:59, 29 July 2006
← Widget API ← Region < IsShown
Determine if the object is "shown" (would be visible if its parent was visible).
shown = MyObject:IsShown();
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 :Show() on an object will make subsequent calls to IsShown() return true. Likewise, calling :Hide() will make subsequent calls to IsShown() return false.
- When an object is initialized, the return value of IsShown() is determined by the XML-attribute "hidden" for the object.
- Objects created via CreateFrame(), Frame:CreateFontString() or Frame:CreateTexture() are initially created shown.
History
- Prior to patch 1.9, FontStrings did not have an :IsShown(). They did have an :IsVisible() method with the behaviour of :IsShown().