WoWInterface - View Single Post - Executing secure code on a RaidFrame click
View Single Post
05-21-20, 06:32 AM   #2
A Scalebane Royal Guard
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 403
You need a header that is like a middle man for everything:
local header = CreateFrame("Frame", nil, nil, "SecureHandlerStateTemplate")

MyTestXD = CreateFrame("Button", "MyTestXD", nil, "SecureHandlerClickTemplate")
header:SetFrameRef("Test", MyTestXD)

local preClick = [[
  local Test = control:GetFrameRef("Test")
  Test:SetAttribute("UnitID", self:GetAttribute("unit"))
  print("Unit targeted saved:", Test:GetAttribute("UnitID"))

header:WrapScript(CompactRaidFrame1, "OnClick", preClick)
  Reply With Quote