Hi!
I am currently trying to understand the SecureUnitButtonTemplate.
Reading a little in the FrameXML, I've come to think, that this example code should basically create a frame that behaven like the player frame:
Code:
f = CreateFrame("Button", nil, UIParent, "SecureUnitButtonTemplate")
f:SetHeight(100)
f:SetWidth(100)
f:SetPoint("TOPLEFT",UIParet, "TOPLEFT", 100, -100)
f:SetAttribute("unit", "player")
f:EnableMouse(true)
f:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",
edgeFile = "",
tile = true, tileSize = 32, edgeSize = 16,
insets = { left = 0, right = 0, top = 0, bottom = 0 }})
RegisterUnitWatch(f)
This frame is automatically shown (and hides, when I set unit as "target"), but I cannot left-click it to target myself and right-click does not produce a menu.
Any help is greatly appreciated.
Greetz
Vaeyl of Nozdormu