gLib2 is a function library. It doesn't do anything by itself, but provides a set of very useful functions for the addon environment. It includes no textures or graphics, so the memory usage is minimal, and it has no running processes or re-occurring event calls, so the CPU time used is 0 when idle.
gLib is specifically designed to be a part of the full UI package gUI, and provides functionality specifically used by most of the addons included in it, but has been written to allow any other addon to use it's functionality as well.
Where is the documentation?
It's a work in progress. More info soon.
- Further expanded the tag database
- Added "Lib: " to the .toc visible name
- Added new tags for short and smart display of time and values
- Fixed a bug with the :Slash() function causing several addons to register slash commands under the same names
- Slightly modified how the task scheduler works
- Removed str:split(), this function already exists in WoW! /doh....
- New functionality for addons, as gLib now handles events and scheduled tasks
- New addon creation functions:
addon = gLib:newAddon( name ) -- creates a new addon. This is NOT a frame, but a table!
addon:OnInit() -- called upon ADDON_LOADED
addon:OnEnable() -- called upon PLAYER_LOGIN
addon:OnDisable() -- called upon PLAYER_LOGOUT
addon:RegisterEvent( event[, func] ) -- register an event for this addon with gLib's event handler
addon:RegisterEvents() -- register multiple events
addon:Schedule( task[, interval] ) -- schedules the function <task> to be called every 0.1 <= interval <= 999 or 0.5 seconds
newclass = addon:newClass( name, parentClass ) -- creates a new class <name> which inherits from <parentClass>
- New API calls added for frames, fontstrings and textures:
:Place(point[, anchor[, relativepoint[, offset x, offset y]]]) -- as SetPoint, but also ClearAllPoints() for you
:Size(width[, height]) -- height = width if height is omitted
- New api calls for strings:
str:tag() -- replaces select tags in the given string; string.tag("[tagname:arg1,arg2,etc]")
str:split( separator ) -- splits a string into a table of substrings based on a separator
:Coin() -- string.tag("[money]") replaces it.
- Unreleased, reverted
- Upgraded the :Coin() function further
- Removed all libraries, kept the shortcuts for backwards compability
- Now embeds all functions into created addons (Except :New(), :AddLocale() and :FetchLocale())
- Now supports embedding into other addons
- Rewrite of the original gLib. Fully backwards compatible.
- DropDown menus are now supported in the gLib.Menu:CreateOptionsPanel() function
- Menu options are now sorted by their key/index
- Added a fail-safe to counter some SetPoint errors
- Added a replacement function for the default OnUpdate timers
- Now unregisters functions and events no longer needed
- Changed the manner of a fail-check in gLib:CreateCheckButton() and gLib:CreateText()