Thread Tools Display Modes
12-03-23, 09:43 PM   #1
dragonflyy
An Aku'mai Servant
 
dragonflyy's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 32
Drag an item to my frame

So I found this older post giving an example of how to drag a spell/item to a frame. However, when I try this is doesn't work.

https://www.wowinterface.com/forums/...ad.php?t=57561


Lua Code:
  1. if(testframe == nil) then --This is built in an in game editor, using check for nil so I don't create multiple frames.
  2.    testframe = CreateFrame("Frame", "aframe", UIParent, "ButtonFrameTemplate")
  3.    
  4.    ButtonFrameTemplate_HidePortrait(testframe)
  5.    ButtonFrameTemplate_HideButtonBar(testframe)
  6.    
  7.    testframe:SetTitle("Drop")
  8.    testframe:SetSize(100,100)
  9.    testframe:SetPoint("LEFT", 100, 0)
  10. end
  11.  
  12. testframe:SetScript("OnMouseUp", function (self, button)
  13.       print(GetCursorInfo())
  14. end)

So what does happen is I grab an item and drag it to the frame while still holding the mouse down. When I release, nothing happens. If I then click and release with the item still on my mouse pointer, it then fires the onmouseup script. How would I register the mouseup when the mousedown didn't happen on that frame?
  Reply With Quote
12-04-23, 03:35 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
You probably want to use OnReceiveDrag
https://warcraft.wiki.gg/wiki/UIHANDLER_OnReceiveDrag
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
12-04-23, 02:10 PM   #3
dragonflyy
An Aku'mai Servant
 
dragonflyy's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 32
Thank you, that's exactly what I needed.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Drag an item to my frame


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