FrameScriptObject:IsObjectType

From Warcraft Wiki
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.

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