I created a template like this
Code:
<Frame name="My_GroupBox" toplevel="true" virtual="true">
<Backdrop bgFile="Interface\ChatFrame\ChatFrameBackground" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<BackgroundInsets>
<AbsInset left="3" right="3" top="5" bottom="3" />
</BackgroundInsets>
<TileSize>
<AbsValue val="16" />
</TileSize>
<EdgeSize>
<AbsValue val="16" />
</EdgeSize>
<Color r="0.1" g="0.1" b="0.1" a="0.5"/>
<BorderColor r="0.4" g="0.4" b="0.4"/>
</Backdrop>
<Layers>
<Layer level="OVERLAY">
<FontString parentKey="label" inherits="GameFontNormal" text="" justifyH="LEFT">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="10" y="15"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
Is it possible to assign functions to this template in this form?
Lua Code:
My_GroupBox:myfunction(
-- do stuffs
)
EDIT: Maybe this can be a solution?
Lua Code:
local mt = {
myfunction = function(self)
-- do stuffs
end
}
setmetatable(My_GroupBox, { __index = setmetatable(mt, getmetatable(My_GroupBox)) })