Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-12-10, 02:47 AM   #1
Ronkkrop
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 6
SetWidth + Anchor point

Hey guys. This is my first attempt at an addon, and it's going pretty awesome except for this little hang up. I have a small movable frame that i want to grow to the right no matter where it is on the screen. Yes, obviously i'm a little bit anal lol, but i do have a button on the left that changes the size of the frame, and its annoying that it gets moved away from my mouse whenever i click it. So anyways, i was told elsewhere that the problem is my anchor point and that after StopMovingOrSizing() i need to re-anchor my frame somewhere left. Which is fine...however doing so results in some wierd bugs. It resizes, and grows just as it should when its anywhere to the left of the screen, and anywhere center, however when i move it to the right side of the screen, my backdrop no longer changes size at all. Also of note is that GetWidth() returns the correct value. Is there any reason for this, is there anything i can do? It moves around via:

Conveniently, getpoint(1) just before StopMovingOrSizing(), seems to have all the right info for anchoring TOPLEFT.
lua Code:
  1. function GoldTracker_OnMouseDown()
  2.    
  3.     GoldTracker_MainFrame:StartMoving()
  4.  
  5. end
  6.  
  7. function GoldTracker_OnMouseUp()
  8.     local gtpoint, gtrelativeTo, gtrelativePoint, gtxOfs, gtyOfs = GoldTracker_MainFrame:GetPoint(1)
  9.  
  10.     GoldTracker_MainFrame:StopMovingOrSizing()
  11.     GoldTracker_MainFrame:SetPoint(gtpoint, gtxOfs, gtyOfs)
  12.        
  13. end

Last edited by Ronkkrop : 01-12-10 at 06:27 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » SetWidth + Anchor point


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