Ok, after messing around for quite a while, I managed to break it down to this:
Code:
local function OnShowButton(button)
local unitid = button:GetAttribute("unit")
local name = UnitName(unitid)
print(unitid..":"..name)
end
local function ConfigureUnitButton(button, other)
-- No attribute data, at this point.
-- When the button is shown, data will be there.
button:SetScript("OnShow", OnShowButton)
end
local function CreateRaidFrame()
local name = "PRHeader1"
local template = "SecureGroupHeaderTemplate"
frame = CreateFrame("Frame", name, UIParent, template)
frame:SetAttribute("template", "SecureUnitButtonTemplate")
frame:SetAttribute("templateType", "Button")
frame:SetAttribute("groupFilter", "1,2,3,4,5,6,7,8")
frame:SetAttribute("showRaid", true)
frame:SetAttribute("showPlayer", true)
frame:SetAttribute("showSolo", true)
frame.initialConfigFunction = ConfigureUnitButton
return frame
end
local RaidFrame = CreateRaidFrame()
RaidFrame:Show()
That seems to be just about the minimum code to get the frames operational.