Wowpedia
Advertisement

Fires when the cursor passes a frame.

(self, motion)

Arguments

self 
Frame - The widget gaining/losing the cursor.
motion 
boolean - True when moving the cursor, false when it remains still -- e.g. Region:Show() or Region:SetPoint().

Details

Example

Displaying a tooltip.

local frame = CreateFrame("Frame")
frame:SetSize(100, 100)
frame:SetPoint("CENTER")

frame:SetScript("OnEnter", function(self)
	GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
	GameTooltip:SetText("HelloWorld!")
	GameTooltip:Show()
end)

frame:SetScript("OnLeave", function()
	GameTooltip:Hide()
end)

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