LibTextDump-1.0

API Reference

Library Methods

:New(frame_title)

Creates an interface.

Arguments

frame_title
string - Text to be displayed on the title bar of the display frame for the interface .

Return Values

interface
table

Example

local LibTextDump = LibStub("LibTextDump-1.0")
local text_dump = LibTextDump:New("This is MY Title")

Interface Methods

:AddLine(text)

Adds a line of text to the interface's buffer.

Arguments

text
string - Text to be added to a new line.

:Clear()

Clears the contents of the interface's buffer.

:Display([separator])

Shows the display frame for the interface, populated with the contents of the interface's buffer.

Arguments

separator
string or nil - Optional separator for concatenating the buffer's lines together. Defaults to a newline.

:InsertLine(position, text)

Inserts a line of text at the specified position in the interface's buffer.

Arguments

position
number - Index of insertion.
text
string - Text to be added to a new line.

:Lines()

Returns the number of lines in the interface's buffer.

:String([separator])

Returns the string representation of the interface's buffer.

separator
string or nil - Optional separator for concatenating the buffer's lines together. Defaults to a newline.

Return Values

interface buffer
string

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of Torhal Torhal Nov 13, 2013 at 17:01 UTC - 0 likes

    @s-conley: Go

    I've updated the docs to show that LibStub is required.

  • Avatar of s-conley s-conley Nov 11, 2013 at 19:08 UTC - 0 likes

    I'm just learning WOW addon programming (LUA). I think I've tried to use this library correctly. I installed it with Curse, enabled it, loaded it in game with another addon. Tried the example: local text_dump = LibTextDump:New("This is MY Title") in a code snippet, and got the following error: <string>:"local text_dump = LibTextDump:New("This is ...":1: attempt to index global 'LibTextDump' (a nil value) IGAS-v54\Loop\Class.lua:7940: in function `Fire' IGAS-v54\System\Widget\Base\UIObject.lua:33: in function <...nterface\AddOns\IGAS\System\Widget\Base\UIObject.lua:32>

    Is there another call I'm supposed to make to initialize this library or am I missing something?

  • 2 comments