I have a problem :S
In my addon i use the function "CreateFrame()" to create some
buttons and frames
It is a chat addon and one frame and one button are dedicated to each
person.
So far no problems.
But when i close the button/frame, (When i'm finshed taking to a person),
is there any posibility to remove the frame and button i have created for this person ??
Ex:
a person named "Dan"
I create some variables for Dan:
Would then destroy the reference to the frame, which would then leave it open to garbage collection. Which is prolly the closest to deleting the frame possible.
And I could be horribly wrong about this too... I just recently started working with frames strictly in Lua.
created frames can't be destroyed.
even if you try to overwrite frames by creating a new one with the same name, the already existing frame will be still existing as well the new one. Which one you get by calling getglobal(framename) i don't know.
if you want to recycle your frames i advise to take a look at Pitbull (it has two funcs to recycle frames).
I don't think frames are garbage collected... after you create them they will exist forever ;)
This is true. Erasing all Lua references to the frame doesn't destroy it.
Your best bet is to use a frame recycling method or create your frames beforehand and simply change their respective attributes as desired when needed.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a problem :S
In my addon i use the function "CreateFrame()" to create some
buttons and frames
It is a chat addon and one frame and one button are dedicated to each
person.
So far no problems.
But when i close the button/frame, (When i'm finshed taking to a person),
is there any posibility to remove the frame and button i have created for this person ??
Ex:
a person named "Dan"
I create some variables for Dan:
Then i create the frame/button:
When i'm done talking with "Dan" i remove his variables and frame/button
!!and here comes the problem!!
now i only know how to hide the frames and buttons i've made.
I need to remove them, so it can be possible to create them again.
is there any way to remove the frame/Button ??? plz help
Sincerely
Unibus
Is it possible to check if a frame/Button excists before you create it
Ex.
If i create a button and hide it
If i now create a new button. Can i check if it already excists ??
Ex. If i wanted to create the same button again
or
-read: http://www.lua.org/pil/3.3.html
As for the first post, do you mean you want to delete the frames??
Edit: Well, could you explain your exact use for these, because I have a feeling you're going about something wrong.
I would think doing something like:
Would then destroy the reference to the frame, which would then leave it open to garbage collection. Which is prolly the closest to deleting the frame possible.
And I could be horribly wrong about this too... I just recently started working with frames strictly in Lua.
even if you try to overwrite frames by creating a new one with the same name, the already existing frame will be still existing as well the new one. Which one you get by calling getglobal(framename) i don't know.
if you want to recycle your frames i advise to take a look at Pitbull (it has two funcs to recycle frames).
This is true. Erasing all Lua references to the frame doesn't destroy it.
Your best bet is to use a frame recycling method or create your frames beforehand and simply change their respective attributes as desired when needed.