Iris2.de

Iris2-Forum
It is currently Sat Nov 28, 2020 4:45 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Adding ToolTip ?
PostPosted: Mon Apr 27, 2009 9:23 pm 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
Want To Add a Tooltip When Mouse Over my Gump Widget?

How can i do it ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 27, 2009 10:11 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
try this :

widget.on_simple_tooltip = function (self)
return "bla"
end

if it doesn't work try this :

widget.on_tooltip = function (self)
StartUOToolTipAtMouse_Text("bla")
end


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 27, 2009 10:13 pm 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
will try both thanks :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 27, 2009 11:10 pm 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
Tried
Code:
local priAbilityWidget = dialog:GetCtrlByName("btnPrimaryAbility")
    priAbilityWidget.tooltip_offx = kUOToolTippOffX -- Both defined at
   priAbilityWidget.tooltip_offy = kUOToolTippOffY -- obj.container.lua
   priAbilityWidgetstylesetname = gGuiDefaultStyleSet
   priAbilityWidget.mobile = body -- for mousepick
   priAbilityWidget.on_tooltip = function (self) return StartUOToolTipAtMouse_Text("BLAH BLAH \n ") end


And

Code:
local priAbilityWidget = dialog:GetCtrlByName("btnPrimaryAbility")
    priAbilityWidget.tooltip_offx = kUOToolTippOffX
    priAbilityWidget.tooltip_offy = kUOToolTippOffY
    priAbilityWidget.stylesetname = gGuiDefaultStyleSet
    priAbilityWidget.on_simple_tooltip = function (priAbilityWidget)
       local  tooltiptext = "BLAH BLAH"
       return (tooltiptext .. " \n ") or "?"
    end


And Can't Make it Work :(


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 28, 2009 11:14 am 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
try widget:SetConsumeChildHit(true)
(i'm not sure, but if the button contains an image, that would be a child widget, and so while you hold the mouse over the image, the tooltip of the button itself wouldn't be triggered. this call could solve the problem)

if that still doesn't work :

add a print("##TOOLTIP METHOD SET") to make sure that the code that
sets priAbilityWidget.on_tooltip is actually executed.

hold the mouse over the widget you want to have a tooltip and make a screenshot please, there are some debug infos in the bottom line, e.g. the widget type.


see lua/widgets/widget.uobutton.lua
for implementation details of the button type if that's what you used.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 28, 2009 2:07 pm 
Offline
Power User
User avatar

Joined: Fri Apr 17, 2009 2:32 pm
Posts: 122
SetConsumeChildHit(true)


That Worked Thanks :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group