Quantcast
WoWInterface - View Single Post - Closing all frames with the same name
View Single Post
04-17-20, 08:48 AM   #1
Milton
A Murloc Raider
Join Date: Apr 2020
Posts: 4
Closing all frames with the same name

I am creating many frames in the same spot, overlapping one another, with this:

local tar_btn = CreateFrame("Button", "get_tar", UIParent, "SecureActionButtonTemplate")

when I click them, they do what I need them to do and then close, one after the other:

tar_btn:SetScript("PostClick", function (self, button, down)
-- if button == "RightButton" then
-- ...
-- end
self:Hide()
self:SetParent(nil)
end)

I want them all to close at the same time when I right click, what command can I give so all frames with the name "get_tar" disappear and get garbage collected when I right click on any one of them?

This didn't work:

if button == "RightButton" then
get_tar:Hide()
get_tar:SetParent(nil)
end

Last edited by Milton : 04-17-20 at 08:56 AM.
  Reply With Quote