View Single Post
02-12-16, 03:59 PM   #14
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
You don't want to actually drag the buttons themselves, you want to activate the container frame onDragxxx

Code:
            
btn:RegisterForDrag("LeftButton");--    Register for left drag
btn:SetScript("OnDragStart", function(self) 
	local f = frame:GetScript("OnDragStart") -- Get the frame OnDragStart script
	f(frame) -- run it
end);
btn:SetScript("OnDragStop", function(self) 
	local f = frame:GetScript("OnDragStop") -- Get the frame OnDragStop script
	f(frame) -- run it
end);
This requires that the frame creation be above the CeateButton function ie. at the top of the file.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-12-16 at 04:03 PM.
  Reply With Quote