Wowpedia
Advertisement

Releasing a mouse button after pressing it overtop a Frame.

(self, button)

Arguments

self 
Frame - The widget on which the mouse button was earlier pressed.
button 
string - "LeftButton", "RightButton", "MiddleButton", "Button4", "Button5", ..., "ButtonN"

Details

Examples

local frame = CreateFrame("Button", nil, UIParent)
frame:SetSize(100, 100)
frame:SetPoint("CENTER")

frame:SetScript("OnMouseDown", function (self, button)
	print("Pressed " .. button)
end)

frame:SetScript("OnMouseUp", function (self, button)
	print("Pressed and released " .. button)
end)

local texture = frame:CreateTexture("BACKGROUND")
texture:SetAllPoints()
texture:SetColorTexture(1,1,1)
Advertisement