View Single Post
03-01-23, 12:23 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
These days it would be done using a Mixin eg.
XML
Code:
<Button name="AchievementFullSearchResultsButtonTemplate" mixin="AchievementFullSearchResultsButtonMixin" virtual="true">
Lua

Lua Code:
  1. AchievementFullSearchResultsButtonMixin = {};
  2. function AchievementFullSearchResultsButtonMixin:Init(elementData)
  3.     -- ...
  4. end

This would "apply" any function defined in the AchievementFullSearchResultsButtonMixin table as a method of the button when the frame using the template is created.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-01-23 at 01:54 PM.
  Reply With Quote