FrameScriptObject:IsObjectType
Jump to navigation
Jump to search
Returns true if the widget object belongs to a given widget type or its subtypes.
isType = FrameScriptObject:IsObjectType(objectType)
Arguments
- objectType
- string
Returns
- isType
- boolean
Details
- This function may return unexpected values when tested with certain abstract types named in the automatically generated API documentation.
- For derivatives of Texture this function will return false if tested against the TextureBase type.
- For derivatives of Frame this function will return true if tested against the Region type, however not all methods present in the documentation for the Region type are available on Frames.
- For all objects this function will return false if tested against the FrameScriptObject, ScriptRegion, ScriptRegionResizing, or AnimatableObject types.
Example
local f = CreateFrame("Button")
print(f:IsObjectType("Button")) -- true
print(f:IsObjectType("Frame")) -- true, Button is also a Frame
print(f:IsObjectType("Region")) -- true, Button is also a Region
print(f:IsObjectType("Object")) -- true, Button is also an Object
print(f:IsObjectType("CheckButton")) -- false, Button is a superclass / parent type of CheckButton