I am working with Blizzard_CraftUI.lua and Blizzard_CraftUI.xml
Neither of those two functions are documented, I am inferring what they do by looking at Blizzards code.
Its the
DoCraft() function that fires the Protected event.
I think its a secure environment that I need? But I cant figure out how to do it. Here's what I've come up with so far:
Code:
local button = CreateFrame("Button", "FrameButton", UIParent, "SecureHandlerBaseTemplate")
button:SetScript("OnClick", function()
local index = GetCraftSelectionIndex()
DoCraft(index)
end)