In this case self is the anchorFrame
Look what happens if I add some outputs to Detach function:
Lua Code:
self.anchorFrame.Detach = function(self)
print("Detach called");
self:SetParent(UIParent);
self:ClearAllPoints();
self:SetPoint("CENTER", UIParent, "CENTER", 0, -150);
print("attached to: " .. self:GetParent():GetName());
LybrialAnchors:OnUpdate();
end
output:
Code:
Detach called
attached to: NamePlate1
How does that make sense? I set parent to UIParent and he is still attached to NamePlate1