View Single Post
03-03-23, 02:13 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
You can use function or method attributes to refer to a Lua function.


This calls MyFrame_OnLoad() from the global environment.
Code:
<Scripts>
	<OnLoad function="MyFrame_OnLoad"/>
<Scripts>

This calls :OnLoad() from the frame's table. Useful for calling functions from inherited mixins.
Code:
<Scripts>
	<OnLoad method="OnLoad"/>
<Scripts>

For more information on handler tags, see WoWPedia: XML/Scripts.


PS: <Backdrop> tags are depreciated and no longer work. You need to inherit BackdropTemplate and call :SetBackdrop() with your custom backdrop.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 03-03-23 at 02:21 PM.
  Reply With Quote