Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

WoWInterface » Developer Discussions » Lua/XML Help » Closing all frames with the same name

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off