A quick example if anyone wants to try.
Code:
local f = CreateFrame("Button", "Fizz_TargetDummy", UIParent, "SecureUnitButtonTemplate")
f:SetSize(65, 30)
f:SetPoint("CENTER", -400, 0)
f:SetAttribute("unit", "target")
RegisterUnitWatch(f)
f.t = CreateFrame("Button", nil, f, "UIPanelButtonTemplate") -- non secure frame to toggle
f.t:SetAllPoints()
f.t:SetText("And Me!")
f.t:SetScript("OnClick", function(self)
print("Clicked!")
end)
local b = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
b:SetSize(140, 30)
b:SetPoint("RIGHT", f, "LEFT", -2, 0)
b:SetText("Click Me In Combat!")
b:SetScript("OnClick", function(self)
f.t:SetShown(not f.t:IsShown()) -- toggle non secure frame
end)
The non secure button frame can be shown/hidden and clicked in combat.
Edit: Silly VM wouldn't update the code section.