GTB

GTB-1.0 is a library for creating timers displayed as bars, graphically it's supposed to resemble CandyBar which is used by addons like BigWigs.

Example of a mod that uses GTB isAfflicted2

GTB SVN

Remarks
Starts a graphical timer bar, if the group is set to redirect to another group it'll check if the redirected group exists if it doesn't then it'll silently show it in the normal group without redirection.

Remarks
Flags the timer as repeating, meaning it'll keep restarting the timer when it hits 0 instead of removing. The only way to stop this is either flag the timer as not repeating, or to remove it through GTBObject:RemoveBar(id) or GTBObject:RemoveAllBars.

Remarks
Registers the passed handler/function to be called when the user stops moving the anchor (OnDragStop fires)

If you passed just a function it'll be called as func(anchorFrame, x, y) If you passed a handler and a function it'll be called as handler[func](handler, anchorFrame, x, y)

Remarks
Registers the passed handler/function to be called when a bar has ran out and is done fading, this is not called if the bar is removed through GTBObject:UnregisterBar(id)

If you passed just a function it'll be called as func(barId) If you passed a handler and a function it'll be called as handler[func](handler, barID)

Remarks
Sets that this group should redirect all new bars created in it to the set one, if the set group does not exist when a bar is created it'll silently ignore this and put it in the group it was registered with.

When bars are redirected to another group, they will use the redirected groups configuration except for the callbacks when the bar fades.

Remarks
Returns the name of the group that all bars from this one will be redirected to, this does not check to make sure the group exists before returning the name.

Remarks
Positioning of the icon in relation to the bars, this only applies to newly created bars if you have one already running you must call GTBGroup:SetBarIcon(id, icon) or re-register the bar to see a change.

Remarks
How the bars should grow, up or down. Changes will take affect immeditially and bars will be repositioned (if needed).

Remarks
Sets the positioning of the bar group, and any bars attached to it.

See API Region SetPoint for more information on arguments as this directly passes the arguments to the anchor frames :SetPoint.

Remarks
By default this is enabled, the bar background color will change from the base color set to red based on how much time is left.