ScriptRegion:EnableMouseWheel

From Warcraft Wiki
Jump to navigation Jump to search

Sets whether the region should receive mouse wheel input.

ScriptRegion:EnableMouseWheel([enable])

Arguments

enable
boolean? = false

Example

local f = CreateFrame("Frame", nil, nil, "BackdropTemplate")
f:SetSize(200, 200)
f:SetPoint("CENTER")
f:SetBackdrop(BACKDROP_TUTORIAL_16_16)

f:SetScript("OnMouseWheel", function(self, delta)
	print("OnMouseWheel", delta)
end)

Details

Setting the OnMouseWheel script automatically implies EnableMouseWheel(true)

local f = CreateFrame("Frame")
print(f:IsMouseWheelEnabled()) -- false
f:SetScript("OnMouseWheel", function() end)
print(f:IsMouseWheelEnabled()) -- true