-
Posted by Omnius on Thu, 20 May 2010 20:58:03
In the BagBuddy addon, you use a function naming convention of
BagBuddy_SomeFunction()
and in CombatStatus you use
CombatStatus:SomeFunction()
Obviously they both work, I was just wondering what the significance of using or not using ':' is. Is it because you created a frame 'CombatStatus' and wanted the functions associated with the frame for some reason where the BagBuddy_* functions didn't need to be associated with the 'BagBuddy' frame in the same way?
-
Posted by jnwhiteh on Thu, 20 May 2010 21:33:44
In the BagBuddy addon, you use a function naming convention of
BagBuddy_SomeFunction()
and in CombatStatus you use
CombatStatus:SomeFunction()
Obviously they both work, I was just wondering what the significance of using or not using ':' is. Is it because you created a frame 'CombatStatus' and wanted the functions associated with the frame for some reason where the BagBuddy_* functions didn't need to be associated with the 'BagBuddy' frame in the same way?
Yes they could have, and they're both valid ways of writing addons. You'll see both in practice. The
BagBuddy_SomeFunction
version uses a global entry for each function, whereas the CombatStatus method hides all the functions in the table.