I have a very simple macro to move 3 of the buttons on the default action bar. The macro works just fine:
Code:
x="MultiBarBottomRightButton"
for i=1,12 do
_G[x..i]:ClearAllPoints()
end
f=function(a,p,x,y)
a:SetPoint("TOPLEFT",p,"TOPRIGHT",x,y)
a:SetFrameStrata("MEDIUM")
end
f(_G[x..1],"UIParent",-1065,-235)
f(_G[x..8],x..1,5,0)
f(_G[x..9],x..8,5,0)
I have this macro keybound and I hit it every time I enter the game. However, for a number of reasons, I'd like the macro to run automatically when I enter the game--so I created an AddOn using Treeston's guide which runs this macro and many others. After logging in, the 3 action buttons are in the correct position, but my bottom right action bar (the one containing these 3 buttons) completely disappears. It isn't difficult to imagine why this might happen:
When I run the macro after my UI is completely loaded, running ClearAllPoints on every button in the action bar leaves them right where they are; but if the macro is run when my AddOn is loaded, it seems the buttons in that bar have not yet been placed, so running ClearAllPoints leaves them somewhere off the screen.
How would you guys solve this? Is there an event that fires after UI layout is complete? If not, maybe there is a function I can post-hook?
Thanks!