It looks like its purely a timing error from between the time that Scott Unhooks ChatFrame1 ( the main chat window ) from its parent and adds it to its new parent regular wow tries to update it. Because it has been reparented there is a delay before it understands its positioning. Assuming of course at this point the new set points are in place. Just had the error occur while my mini addon was running and it picked up the fact that GetTop and GetBottom were returning nil values and/or GetLeft and GetRight rofl. Can't remember now
I had a similar problem with my watch frame the other day and once I simply put an anchor in place the error went away. It was just the case of timing it so I could replace it with the correct anchor afterwards
http://www.wowwiki.com/API_Region_GetTop
This function is only guaranteed to work after the PLAYER_LOGIN event and then, only if the object in question is being Shown. Also, currently if you re-anchor an object or Show it, you will need to wait until after the next OnUpdate event before this function will return the correct new value
|
The block of code I am testing for this is :
Code:
for i=1, NUM_CHAT_WINDOWS do
local cframe = _G["ChatFrame"..i];
local exists = ( cframe ~= nil );
testtab2["ChatFrame"..i] = {};
testtab2["ChatFrame"..i].Exists = exists;
if ( cframe ) then
testtab2["ChatFrame"..i].isDocked = cframe.isDocked or false;
if ( cframe:GetRight() and cframe:GetLeft() and cframe:GetTop() and cframe:GetBottom() ) then
testtab2["ChatFrame"..i].DimensionsValid = true;
testtab2["ChatFrame"..i].Error = false;
testtab2["ChatFrame"..i].Result = "OK";
else
testtab2["ChatFrame"..i].DimensionsValid = false;
testtab2["ChatFrame"..i].Error = true;
testtab2["ChatFrame"..i].Result = "Reloading...";
--ReloadUI();
end
end
end
I tried an onupdate routine on both the frame having problems ( the watchframe in my case ) and the event frame but no dice. So it looks like it needs to be anchored sooner rather than later even if it is only temporary while it processes the other stuff.