Run when the frame receives a mouse wheel scrolling action. In order for this handler to be run, the frame must be mouse wheel enabled and the mouse cursor must be within the frame while the scroll wheel (or equivalent device) is used.
self- Reference to the widget for which the script was run (
1for a scroll-up action,
-1for a scroll-down action (
-- Print the mousewheel delta for a button CreateFrame("Frame", "test", UIParent, "UIPanelButtonTemplate") test:SetPoint("CENTER") test:EnableMouseWheel(true) test:SetScript("OnMouseWheel", function(self, delta) DEFAULT_CHAT_FRAME:AddMessage(delta) end)