WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   frame position problem... (https://www.wowinterface.com/forums/showthread.php?t=38765)

Wex_dsh 02-06-11 10:43 AM

frame position problem...
 
Hiho,

My frame does not show up where I set it to show up. Here is what I did:

* I created a frame "MyFrame" linked to UIParent.
* I linked events to it, set Width and Hight and Background, and Show() it.
* I created another frame "iFS_F" and linked it to MyFrame.
* This one is moveable and moving works in general.
* But: After a /Reload UI iFS_F shows up again at the position where I moved it to before, even though I do this:

...
iSF_F:ClearAllPoints();
iSF_F:SetPoint("CENTER", My_Frame, "CENTER", 0, 0);
iSF_F:Show();

It should show up in the center of the screen, where My_Frame is too, but it is not, it is where ever I moved it to before /reload ui. Why?
Is there some caching going on that I donŽt know of?
Are the two Zeros there in the second line not the position?

Can anyone explain this to me?

Ailae 02-06-11 10:56 AM

I'm guessing you are doing :SetUserPlaced(true) on your frame and as such its position will be stored in layout-local.txt in that characters WTF-folder. This will, depending on when you try to reposition it, overwrite what you are doing iirc.

kneeki 02-06-11 10:57 AM

Likely, your code is running before the Blizzard code does. Try registering ADDON_LOADED and having it try the positioning when your addon loads.

Wex_dsh 02-06-11 12:40 PM

Okay, thanks so far, but both cases I ruled out already.

I had indeed :SetUserPlaced(true) in there before, but removed it once I found out what it does.
Is it possible that the game still remembers this (as you say from the WTF folder) ?

The other hint with the ADDON_LOADED was also something that I had before not taken care of, but I fixed this also already.

IŽll check my WTF folder now and try again.


So the two last parameter from setpoint() are the only coordinates I need to worry about?

kneeki 02-06-11 11:43 PM

Could you make a pastey of your code?

lilsparky 02-07-11 12:05 AM

StartMoving/Sizing automatically enable the SetUserPlaced flag. you need to turn it off after you're done moving your frame.


All times are GMT -6. The time now is 02:10 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI