View Single Post
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