Thread Tools Display Modes
07-25-08, 09:35 PM   #1
Woodstriker
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 2
Movable Frame Issue

I'm trying to learn how to make my own GUI so I've been fooling around with some of the frame code. I haven't had many issues figure the syntax out, but I'm confused about a movable frame that I created. I added two scripts to the frame with the following code:
Code:
HappyFrame:SetScript("OnMouseDown", function() HappyFrame:StartMoving() end);
HappyFrame:SetScript("OnMouseUp", function() HappyFrame:StopMovingOrSizing() end);
The frame moves happily around the screen when I drag it with left click, but when I right click on it, it jumps in the last direction that my mouse moved. Is there a reason why it would jump when I right click on it even though I never set it to do so? Thanks for the help!
  Reply With Quote
08-13-08, 05:13 PM   #2
warcrazy
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 4
Just a thought but maybe if you registered the 'RightButton' for dragging, this behavior would stop. See http://www.wowwiki.com/API_RegisterForDrag for details.
  Reply With Quote
08-13-08, 05:31 PM   #3
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Use OnDragStart and OnDragStop

Code:
HappyFrame:SetScript("OnDragStart", function() HappyFrame:StartMoving() end);
HappyFrame:SetScript("OnDragStop", function() HappyFrame:StopMovingOrSizing() end)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Movable Frame Issue


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