Thread Tools Display Modes
12-01-22, 01:42 PM   #1
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
help creating a tooltip for button

im trying to get a tooltip for my config frame, cant seem to get it to work though anyone have any ideas?
button works but the mouse of tool tip does not.
Lua Code:
  1. local frame = CreateFrame("Button", "Options7", Config_BaseFrame, nil)
  2.     frame:SetHeight(96)
  3.     frame:SetWidth(96)                       
  4.     frame:SetNormalTexture("Interface\\AddOns\\_Deranjata\\media\\cfgiwin\\paladin.tga")                     
  5.     frame:SetPushedTexture("Interface\\AddOns\\_Deranjata\\media\\cfgiwin\\paladin.tag")                     
  6.     frame:SetHighlightTexture("Interface\\AddOns\\_Deranjata\\media\\cfgiwin\\paladin.tga")
  7.     frame:SetText("")
  8.     frame:ClearAllPoints()
  9.     frame:SetPoint("BOTTOM", 96, 60)
  10.     Options7:SetScript("OnClick", function() PALADIN_OnClick()
  11. end)
  12.  
  13. function Options7_OnEnter()
  14.     GameTooltip_SetDefaultAnchor( GameTooltip, UIParent )
  15.     GameTooltip:SetText( "Paladin" )
  16.     GameTooltip:Show()
  17. end
  18.  
  19. function Options7_OnLeave()
  20.     GameTooltip:Hide()
  21. end
__________________
  Reply With Quote
12-01-22, 03:31 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
Looking at the code you put there I am sure you are missing the Script assignments for OnEnter and OnLeave to call your functions for that functionality. At the moment I think the frame is unaware of them and thus can't show a tooltip.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
12-01-22, 04:37 PM   #3
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by Xrystal View Post
Looking at the code you put there I am sure you are missing the Script assignments for OnEnter and OnLeave to call your functions for that functionality. At the moment I think the frame is unaware of them and thus can't show a tooltip.

thank you for the eye balls, i fixed it and i will leave the code here so others may look at it later
Lua Code:
  1. local frame = CreateFrame("Button", "Options7", Config_BaseFrame, nil)
  2.    frame:SetHeight(96)
  3.    frame:SetWidth(96)
  4.    frame:SetNormalTexture("Interface\\AddOns\\_Deranjata\\media\\cfgiwin\\paladin.tga")
  5.    frame:SetPushedTexture("Interface\\AddOns\\_Deranjata\\media\\cfgiwin\\paladin.tag")
  6.    frame:SetHighlightTexture("Interface\\AddOns\\_Deranjata\\media\\cfgiwin\\paladin.tga")
  7.    frame:SetText("")
  8.    frame:ClearAllPoints()
  9.    frame:SetPoint("BOTTOM", 96, 60)
  10.  
  11. Options7:SetScript("OnEnter", function(self)
  12.    GameTooltip:SetOwner(self, "ANCHOR_CURSOR");
  13.    GameTooltip:ClearLines();
  14.    GameTooltip:SetText("PALADIN", 0.990, 0.614, 0.946, 0.75, 1)
  15.    GameTooltip:Show() PlaySound(53693)
  16. end)
  17.                        
  18. Options7:SetScript("OnLeave", function(self)
  19.    GameTooltip:Hide()
  20. end)
  21.                    
  22. Options7:SetScript("OnClick", function() PALADIN_OnClick()
  23.  
  24. end)
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » help creating a tooltip for button


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off