If anyone stumbles upon this Post there is the working code.
Code:
--parent frame
local frame = CreateFrame("Frame", "TestFrame", ParentUI)
frame:SetSize(400, 200)
frame:SetPoint("CENTER")
local texture = frame:CreateTexture()
texture:SetAllPoints()
texture:SetTexture(0,0,0,0)
frame.background = texture
local button = CreateFrame("CheckButton", "ButtonA", TestFrame, "UIPanelButtonTemplate")
button:SetText("ButtonA")
button:SetPoint("LEFT",0,0)
button:SetWidth(120)
button:SetHeight(50)
button:SetScript("OnClick",
function()
ButtonA:SetChecked()
end);
local button = CreateFrame("CheckButton", "ButtonB", TestFrame, "UIPanelButtonTemplate")
button:SetText("ButtonB")
button:SetPoint("CENTER",0,0)
button:SetWidth(120)
button:SetHeight(50)
button:SetScript("OnClick",
function()
ButtonB:SetChecked()
if ButtonA:GetChecked() and ButtonB:GetChecked() then
ButtonC:Show()
end
end);
local button = CreateFrame("CheckButton", "ButtonC", TestFrame, "UIPanelButtonTemplate")
button:SetText("ButtonC")
button:SetPoint("RIGHT",0,0)
button:SetWidth(120)
button:SetHeight(50)
button:Hide()
button:SetScript("OnClick", function()
ButtonC:Hide()
ButtonA:SetChecked(false)
ButtonB:SetChecked(false)
end)