Changes: UIHANDLER OnEnter


Back to page

m (catfix, Replaced: {{widgethandler}} → {{widgethandler}}<br>)
(Updating with 2.0 (required in 3.0) variable names)
Line 9: Line 9:
== Arguments ==
== Arguments ==
No known arguments
self - the frame being entered
motion - unknown
== Example ==
== Example ==

Latest revision as of 23:06, August 13, 2008

Widget handlers < OnEnter

Description Edit

The OnEnter handler is called when the user mouse pointer enters the frame.

A typical use for this event is to pop up a help tooltip, or a menu with option choices (for instance on a minimap button). The opposite of OnEnter is OnLeave. If you decide to show something in OnEnter you should hide it again in the OnLeave event handler.

Arguments Edit

self - the frame being entered

motion - unknown

Example Edit

This example illustrates how to use OnEnter and OnLeave to display a mouseover help text in the GameTooltip.

Declare the event handlers in the "Scripts" section of your frame:

<Frame name="MyFrame">
    <OnEnter> MyFrame_OnEnter() </OnEnter>
    <OnLeave> MyFrame_OnLeave() </OnLeave>

Place the actual functions in one of your LUA files:

function MyFrame_OnEnter()
  GameTooltip_SetDefaultAnchor( GameTooltip, UIParent )
  GameTooltip:SetText( "This text shows up when you mouse over\nthe MyFrame frame" )

function MyFrame_OnLeave()

Around Wikia's network

Random Wiki