GetCursorInfo() says what's on the cursor. You can call that when your button receives something:
Lua Code:
local f = CreateFrame("ItemButton","RdD",UIParent)
f:SetPoint("CENTER",-200,0)
local function onReceive(self)
local cursorType, cursorID, cursorLink = GetCursorInfo()
if cursorType=="item" then
local _,_,_,_,icon = GetItemInfoInstant(cursorID)
self.icon:SetTexture(icon)
ClearCursor()
end
end
f:SetScript("OnReceiveDrag",onReceive)
f:SetScript("OnClick",onReceive)