Thread Tools Display Modes
02-06-11, 10:43 AM   #1
Wex_dsh
A Defias Bandit
Join Date: Feb 2011
Posts: 2
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?
  Reply With Quote
02-06-11, 10:56 AM   #2
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
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.
__________________
Oh, the simulated horror!
  Reply With Quote
02-06-11, 10:57 AM   #3
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Likely, your code is running before the Blizzard code does. Try registering ADDON_LOADED and having it try the positioning when your addon loads.
  Reply With Quote
02-06-11, 12:40 PM   #4
Wex_dsh
A Defias Bandit
Join Date: Feb 2011
Posts: 2
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?
  Reply With Quote
02-06-11, 11:43 PM   #5
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Could you make a pastey of your code?
  Reply With Quote
02-07-11, 12:05 AM   #6
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
StartMoving/Sizing automatically enable the SetUserPlaced flag. you need to turn it off after you're done moving your frame.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » frame position problem...

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off