I'm still trying to wrap my head around building interfaces and was hoping someone can point me in a direction. I currently have a frame with a scrollbar, and I'm trying to populate rows in that frame with a loop:
Lua Code:
for index=1,GetNumShapeshiftForms(),1 do
icon, name, active = GetShapeshiftFormInfo(index)
MyAddOn_BuildStanceListItem(f.ScrollFrame, index, icon, name, active);
end
Inside my function to build each row, I'm currently attempting to load the texture for each shapeshift form inside my scrolling frame, but I don't seem to get a single icon to appear.
Lua Code:
function MyAddOn_BuildStanceListItem(f, index, icon, name, active)
print("Building List Item");
print("Icon: " .. icon);
local texture = GetSpellTexture(icon);
print("Texture: " .. texture);
local ListItem = CreateFrame("Frame", "MyAddOnListItem"..index, f);
print("Created ListItem");
ListItem:ClearAllPoints();
ListItem:SetPoint("TOPLEFT", f);
ListItem:SetSize(315, 68);
print("Creating AuraIcon");
local AuraIcon = CreateFrame("Frame", "StanceIcon"..index, ListItem);
print("Setting Width");
AuraIcon:SetWidth(68);
print("Setting Height");
AuraIcon:SetHeight(68);
print("Creating Texture");
local tg = AuraIcon:CreateTexture(nil, "ARTWORK");
tg:SetTexture(texture);
tg:SetSize(68, 68);
tg:SetPoint("LEFT");
AuraIcon.texture = tg;
end
I'm floundering trying to figure out if I'm incorrectly loading the textures, dealing with frames in an incorrect way, or both. I don't need anything to happen if the texture is pressed, I just want to use it as artwork inside the scroll frame to accompany a font string. While I may need to consider offsets between indicies, I anticipated at least one icon to appear.