A library for implementing object-oriented frame classes with inheritance in World of Warcraft.
Simulating frame classes in World of Warcraft is not simple: Lua does not support classes by default and frames cannot be deallocated once created. Even further, frames can be assigned to xml
templates and global names, which cannot be changed once set. Recently, Blizzard added APIs for handling classes as mixins, but they also come with their own set of limitations.
Creating frames in World of Warcraft is extremely simple:
frame = CreateFrame('Frame', 'SomeFrame', SomeParent, 'SomeTemplate')
Creating a new frame class using Poncho is very similar:
class = LibStub('Poncho-2.0'):NewClass('Frame', 'FrameNames', 'SomeTemplate')
Frames can then be created by calling the class object itself:
frame = class()
Subclasses then can be recursively inherited:
sublass = class:NewClass()
Classes also behave as frame pools, so frames can be released:
frame = class()
frame:Release()
For a quick guide on writting classes using Poncho and an API reference check the wiki.
If you use this library, please list it as one of your dependencies in the CurseForge admin system. It's a big help! 👍