View Single Post
03-06-09, 05:15 PM   #13
Antichrist
A Defias Bandit
Join Date: Mar 2009
Posts: 3
Actually not tested, because I got some problems with my own addon...but just copied and pasted from my code...

-- Declare and Initialise
local LBF = LibStub("LibButtonFacade", true)

-- Create a "Group" for your Addon (listed in BF's-Interace)
grp = LBF:Group("WarlocksChoice")

-- Register an Event to be executed if Skin has changed
LBF:RegisterSkinCallback("WarlocksChoice", OnSkin, self)

--Now you can start to create your LUA-Buttons as usual
-- Code missing here for the standard-buttons


-- but every button must be added additionally as ButtonFacade-Button
-- See lines below
txt = frame:CreateTexture(nil)
txt:SetTexture("Path to your texture here")
local btnData = {Normal = txt}
-- where Normal would be similar to SetNormalTexture
-- I was not able to solve this without this line of code
-- otherwise My button would not have any texture. Maybe you find this out

-- Finally now add this Button to BF
grp:AddButton(Button, btnData)



-- After you created all Butttons and added them to BF as well,
-- you have to skin your Button-Group


grp:Skin(WLCConfig.BFSkin, WLCConfig.BFGloss, WLCConfig.BFBackdrop)
-- where WLCConfig.BFSkin, BFGloss and BFBackdrop are saved variables from the last settings done in ButtonFacade

-- These Variables will be save within the OnSkin-Event you
-- already have registered in the first lines of code here

function OnSkin(args, skin, gloss, backdrop, group, _, colors)
WLCConfig.BFSkin = skin
WLCConfig.BFBackdrop = backdrop
WLCConfig.BFGloss = gloss
end


Hope this will help you. Would be great to get a short reply.
Rgds,
Val
  Reply With Quote