Probably easier just apply a backdrop and close button to the addon frame
Lua Code:
if BackdropTemplateMixin then
Mixin(LocationMessageView, BackdropTemplateMixin)
end
LocationMessageView:SetBackdrop({
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background",
edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border",
tile=1, tileSize=32, edgeSize=32,
insets={left=11, right=12, top=12, bottom=11}
})
LocationMessageView.Close = CreateFrame('Button', '$parentClose', LocationMessageView, "UIPanelCloseButton")
LocationMessageView.Close:SetPoint('TOPRIGHT', 0,0)
LocationMessageView.Close:SetSize(30, 30)
LocationMessageView.Close:SetFrameLevel(4)