UIOBJECT GameTooltip Introduction . Tooltips are notoriously difficult to handle in WoW UI code , as the interaction of GameTooltip methods can be quite complicated . This page has some examples for the use of tooltips , and a collection of advanced points to note about the finer details . For an indepth analysis of GameTooltip methods , see Tooltip Pseudo Code for a Lua - ish pseudo code representation of every GameTooltip method . See Widget API for a reference list of all GameTooltip methods . Blizzard ' s GameTooltip . The default Blizzard interface code ( FrameXML ) defines a GameTooltip object called GameTooltip ( confusing , eh ) . This is used as the game ' s main tooltip . It consists of a number of lines ; to determine how many there are , you can call the GameTooltip : NumLines ( ) function . The game engine assumes that there is a GameTooltip object called GameTooltip , and that it has a number of known fontstrings in it . The GameTooltip : Set _ _ _ ( ) methods manipulate the object and its children directly and then show the tooltip object . When you mouse over things in the game world , the game engine internally calls the equivalent of : Set _ _ _ _ ( ) - not the actual Lua method . In particular , this means that hooked GameTooltip methods will never trigger for engine - generated tooltips . Hooks will however catch all other tooltips generated from the UI itself . For non - item / unit tooltips you will even see : AddLine and : AddDoubleLine calls . GameTooltipTextLeft " < num > " . Each line of text from the game tooltip is represented by one of these objects , replace < num > with the appropriate line number ( from 1 to the number of lines returned from GameTooltip : NumLines ( ) ) . To obtain the text of a line call the GameTooltipTextLeft " < num > " : GetText ( ) function . Warning - this is currently bugged . When a tooltip has 9 or more FontString GameTooltipTextLeft9 and GameTooltipTextRight9 do not exist . These FontStrings are incorrectly named GameTooltipTextLeft1 and GameTooltipTextRight1 duplicating those of the first line . The only reliable way to get the information out of the tooltip is to iterate through its child regions with GameTooltip : GetRegions ( ) . GameTooltipTextRight " < num > " . Some tooltips have both left - and right - aligned sections . In order to get at the right - aligned section , use one of these objects instead of a GameTooltipTextLeft . Otherwise , the functionality is identical . Hidden tooltip for scanning . One of the most common uses of a tooltip is to use it to gain information text about an item , buff or spell . Many AddOns define their own tooltip for this purpose . This is a description of the best practice to follow when using a tooltip for this purpose , taking into account the need for performance . The definition of the tooltip in your XML should look like this : When actually using the tooltip in your code , you need to do : where SetX could be SetInventorySlot , SetBagItem , SetAction , SetUnitBuff etc . The explicit call to MyScanningTooltip : ClearLines ( ) is necessary becuase a SetX call usually doesn ' t clear the tooltip if called with invalid arguments , e . g . an empty bag slot or nonexistent buff . Care must be taken so that MyScanningTooltip : Show ( ) or MyScanningTooltip : Hide ( ) doesn ' t get called at any time , otherwise the tooltip becomes unusable . Note that the way SetOwner was called , the tooltip will never be visible on the screen , and therefore it ' s not necessary to hide it . Alternative solution . Instead of the above , here is an alternative solution . It is sufficient to have this in your XML : Each time you want to use the tooltip however , you must explicitly set the owner like this : This solution is safer and more robust to potential changes to tooltip behaviour in future patches . However , this solution incurs significant performance penalty . Repeatedly calling MyScanningTooltip : SetOwner in an OnUpdate handler can cause significant frame - rate drop . Hence this solution is recommended for tooltip scans that occur in response to for example key presses , whereas the previous solution is recommended for repeated , frequent scans . Pure Lua compact solution . To create a GameTooltip without the overhead of inherited GameTooltipTemplate properties , a minimal scanning tooltip can be created in pure Lua as follows : The resulting tooltip will not contain a status bar , icons , backdrop , or any event handlers . Like the other ways to create scanning tooltips , you should call MyScanningTooltip : ClearLines ( ) before calling any MyScanningTooltip : SetX ( ) methods . " Note that using this method , tooltip icons ( such as sockets ) will not be added . " Advanced Notes on GameTooltip methods . This is a list of the finer details of using tooltips correctly :