It’s imposible to tell without seeing the code but I’m guessing whatever widget your close button is hiding, it’s not the one you think it is.
Using the code from the other thread, a grey frame with randomly class coloured backgrounds to fontstrings/texture combinations with a close button and a show/hide slash command (/ca)
And a print of the class colors including hex.
local Units = {}
local topOnLine
local classes = {
"DRUID",
"HUNTER",
"PRIEST",
}
for k, v in pairs(classes) do
local color = C_ClassColor.GetClassColor(v)
print(v, color.r, color.g, color.b, color:GenerateHexColor())
end
local function CreateUnit(parent, id)
local f = parent:CreateTexture()
Units[id] = f
f:SetSize(75, 18)
f:SetTexture("Interface/BUTTONS/WHITE8X8")
local class = random(1, #classes)
local color = C_ClassColor.GetClassColor(classes[class])
f:SetVertexColor(color.r, color.g, color.b)
f.Text = parent:CreateFontString()
f.Text:SetFont("Fonts\\FRIZQT__.TTF", 16)
f.Text:SetTextColor(54/255, 69/255, 79/255)
f.Text:SetPoint("CENTER", f)
if id == 1 then
f:SetPoint("TOPLEFT", 5, -5)
topOnLine = f
elseif mod(id-1, 5) == 0 then
f:SetPoint("LEFT", topOnLine, "RIGHT", 5, 0)
topOnLine = f
else
f:SetPoint("TOP", Units[id-1], "BOTTOM", 0, -5)
end
f.Text:SetText("Raid"..id)
end
local f = CreateFrame("Frame", "CanackiAddonFrame", UIParent)
f:SetSize(560, 120)
f:SetPoint("TOPLEFT", 20, -20)
f.Texture = f:CreateTexture()
f.Texture:SetAllPoints()
f.Texture:SetTexture("Interface/BUTTONS/WHITE8X8")
--f.Texture:SetVertexColor(54/255, 69/255, 79/255)
f.Texture:SetBlendMode("DISABLE")
f.Texture:SetVertexColor(0.5, 0.5, 0.5)
f.Close = CreateFrame("Button", "$parentClose", f, "UIPanelButtonTemplate")
f.Close:SetSize(60, 25)
f.Close:SetText("Close")
f.Close:SetPoint("TOPRIGHT")
f.Close:SetScript("OnClick", function(self)
self:GetParent():Hide()
end)
for i=1, 25 do -- add 25 "units"
CreateUnit(CanackiAddonFrame, i)
end
Units[25].Text:SetText("Last Unit") -- change the name of the last unit
CreateUnit(CanackiAddonFrame, #Units + 1)
Units[#Units].Text:SetText("No I am") -- change the name of the last unit
_G["SLASH_CanackiAddon1"] = "/ca"
SlashCmdList.CanackiAddon = function(msg)
CanackiAddonFrame:SetShown(not CanackiAddonFrame:IsShown())
end