View Single Post
06/21/14, 08:57 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by CrazyDutchGuy View Post
Does anyone know how to extract the text from a PopupTooltip ?

I can't find the text controls for the object, there are no handlers to request the information from the tooltip or the objects it is derived from.

Anyone know if it is even possible to do it ?
I didn't find a way. Even if I'm able to go through the lines and show or hide them, I can't get any text from them. Each line is just a container and I don't have a clue how to access its chidren.

Lua Code:
  1. TOOLTIP_LINES = {}
  2. local nextLine = true
  3. local container
  4. PopupTooltip:AddControl(WINDOW_MANAGER:CreateControl("MY_CONTROL", PopupTooltip, CT_LABEL))
  5. local container = MY_CONTROL:GetParent()
  6. while nextLine do
  7.    local nextLine = select(3,container:GetAnchor(0))
  8.    if nextLine == PopupTooltip then break end
  9.    table.insert(TOOLTIP_LINES, 1, nextLine)
  10.    container = nextLine
  11. end
  12.  
  13. --inspect lines using the /zgoo TOOLTIP_LINES

Last edited by Garkin : 06/21/14 at 09:09 AM.
  Reply With Quote