at the moment i'm developing my first addon with ACE3.
So far no problem, i got the most points.
But now i have a simple problem, how can i store my frame position?
I'm having a function which builds the UI (AceGUI frame widget) for my addon.
I'm also using an ACE3-DB to store some profile settings.
On the ui creation i want using this db to restore the window positon.
local frame = AceGUI:Create("Frame");
-- removed the rest
-- restore position code
if self.db.profile.position.x and self.db.profile.position.y and self.db.profile.position.anchor and self.db.profile.position.point then
frame.frame:SetPoint(self.db.profile.position.point, UIParent, self.db.profile.position.anchor, self.db.profile.position.x, self.db.profile.position.y);
frame.frame:SetPoint("CENTER", UIParent, "CENTER");
--- and so on
But which event or script event (for example
i could use to store the position to the profile database?
I only found the OnClose callback. Can i use this? Is this callback allways triggered if the user logs out?
As a general rule you should only use the public API for a widget, no using of widget.frame or at least only in the purpose of reading things, it is the only guarantee you are not screwing things up for the next user.
Hint : instead of doing frame.frame:SetPoint, do frame:SetPoint()
As for your problem, test it but chances are that logging out will not fire OnClose script.
The solution to use the OnUpdate script is NOT a good one if I understand correctly the intricacies of wow...
I think you could open a ticket for Nev to add a OnMovementStart / Stop callback on the frame