Is this a sequence problem? Am I setting up my tooltip properly? Is it possible for CowTip and LibQTip to work together?
I'm sort of worried because I've actually stopped using addons in the past if their tooltips didn't match, but this is my own addon. :P
Afaik, CowTip and similar tooltip addons are used to manipulate the GameTooltip. LibQTip creates its own and the initial border/background/alpha/scale/strata/colors are hardcoded in the lib to match the default ones used by the GameTooltip. If you want to change them you will need to do so by using your addon's tooltip frame and relevant methods after the tooltip has been acquired (and imo populated). You should be able to keep font settings though.
I now run the following function just prior to Show():
function EggTimer:PrepareTooltipLook(frame)
frame:SetBackdrop(GameTooltip:GetBackdrop())
frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
frame:SetBackdropColor(GameTooltip:GetBackdropColor())
frame:SetScale(GameTooltip:GetScale())
end
Works like a charm!
I have to wonder though, if this sort of thing might be included in LibQTip at some point though. That way any addon that uses it will fit in with everything else when skinning/theming addons are in use? Something to think about, anyhow.
Maybe the code that copies these from the GameTooltip in the first place could be moved over to the beginning of the Show() code or something?
I now run the following function just prior to Show():
function EggTimer:PrepareTooltipLook(frame)
frame:SetBackdrop(GameTooltip:GetBackdrop())
frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
frame:SetBackdropColor(GameTooltip:GetBackdropColor())
frame:SetScale(GameTooltip:GetScale())
end
Works like a charm!
I have to wonder though, if this sort of thing might be included in LibQTip at some point though. That way any addon that uses it will fit in with everything else when skinning/theming addons are in use? Something to think about, anyhow.
Maybe the code that copies these from the GameTooltip in the first place could be moved over to the beginning of the Show() code or something?
Actually this code is interesting :p Let's see what the rest think about it.
Unless Adirelle or someone else comes up with a compelling reason as to why it would be a bad idea...
I don't. We wanted QTips to look like GameTooltip from the beginning. However it might have some funny behavior if the GameTooltip had a funny state when we acquire the tooltip.
Tooltips are such fleeting creatures, even if the GameTooltip properties are strange it will only be noticed for a second or too. I see LibQTipClick having more problems though, as those frames tend to have a longer lifetime.
And then there's the use of QTip for non-tooltip frames, that darn column functionality is just so tasty. :)
On another matter, is it possible to merge 2 cells? I have a 2 column layout, in my tooltip, but I want my "Click to configure" text to sit in a cell that spans the entire row.
On another matter, is it possible to merge 2 cells? I have a 2 column layout, in my tooltip, but I want my "Click to configure" text to sit in a cell that spans the entire row.
Yes:
tooltip:SetCell(lineNum, colNum, "Click to configure", 2)
What do you mean? LibQTipClick has exactly the same lifetime properties as LibQTip.
Oh, I was just making a casual assumption about how we might use these libraries. Tooltips only visible on mouse-over, and it's usually useful morsel of information and nothing more. You could use LibQTipClick for menus and things requiring actual interaction, therefore it's uses are probably going to be more prolonged.
If the snapshot of GameTooltip properties is fishy, then you'll only notice it for the one tooltip (assuming it is momentary). It takes longer to use a menu (in theory) so the ugliness would be less brief.
I'm getting more ambitious now and I've moved on to using LibQTipClick for one of my addons. My problem is I don't really know the best way to hide the tooltip.
I tried setting my HideTooltip callback to the tooltip's OnLeave, but this seems to fire when the mouse enters a cell. I suppose the mouse has technically left the tooltip and now inhabits an internal frame instead. Any chance we can get this behaviour changed? Or I could just be on crack.
Should I just put a "Close" cell somewhere and get people to click it to dispose of the tooltip? Seems sort of yucky.
I eventually want to have the primary tooltip spawn a little baby tooltip off to the side somewhere for certain cells.
You'll have to set an OnLeave() for the tooltip and check the state of the mouse in your hide function - something like this:
local function HideTooltip()
if MouseIsOver(tooltip) then return end
tooltip:SetScript("OnLeave", nil)
QTC:Release(tooltip)
tooltip = nil
end
function DO.OnEnter(self)
tooltip = QTC:Acquire("TesterTooltip", 4, "LEFT", "LEFT", "CENTER", "CENTER")
tooltip:SmartAnchorTo(self)
tooltip:SetScript("OnLeave", HideTooltip)
DisplayTooltip()
end
function DO.OnLeave(self)
HideTooltip()
end
Okay, so I've got this working now. Thanks for the hints, Torhal. <3
I've noticed that the tooltip is only cleared now if I move the mouse slow enough to pass through the outer frame first. Too fast, and the event doesn't happen. It's weird. I'm going to mess about more with the callbacks and see if I can wrangle together something better.
Also, I don't have any callbacks for any of the cells set. When I click the cells, I get a message in the chat window from LibQTipClick. I suppose I'll have to register callbacks to quiet it?
I actually don't want most of the cells to do anything, just a few of them. Is there a way to disable the mouseover highlight effect (on a per-cell basis would be nice)?
Okay, so I've got this working now. Thanks for the hints, Torhal. <3
I've noticed that the tooltip is only cleared now if I move the mouse slow enough to pass through the outer frame first. Too fast, and the event doesn't happen. It's weird. I'm going to mess about more with the callbacks and see if I can wrangle together something better.
Also, I don't have any callbacks for any of the cells set. When I click the cells, I get a message in the chat window from LibQTipClick. I suppose I'll have to register callbacks to quiet it?
I actually don't want most of the cells to do anything, just a few of them. Is there a way to disable the mouseover highlight effect (on a per-cell basis would be nice)?
Just noticed that even when using AddNormalLine() and AddNormalHeader(), as soon as you use SetCell() you get an interactive cell. If there isn't another way to disable this behaviour, perhaps a SetNormalCell() routine is called for?
Dunno if that a bug nor a manipulation error from me but just after reloading or connect the UI, the first time I mouseover the QTip-ed frame, it does not update well I mean It does not look the way I have defined it but behaviour is gone when I mouseover it a second time, so anytime after I reloadui nor connect, the first tooltip displayed is broke and doesnt look what I want, if I OnLeave and Enter again on it it shows fine this time.
below is how looks like my tip
local ldb = LDB:NewDataObject("EasyDND", { --LDB
type = "data source",
text = CheckLDBFlag(),
icon = ICONON,
OnClick = OnLDBClick,
OnEnter = OnLDBEnter,
OnLeave = OnLDBLeave,
})
local function OnLDBEnter(self)
local db = _.db.profile
if db.showtooltip then
local tip = TIP:Acquire("EasyDNDQTip", 3, "LEFT")
self.tooltip = tip
local t = tip:AddHeader("")
tip:SetCell(t, 1, ("|cfffed000EasyDND|r r|cff7fff7f%s|r |cfffed000by|r |cffabd473Merah|r"):format(_G.EasyDND_MINOR_VERSION), "CENTER", 3)
local t = tip:AddHeader("")
tip:SetCell(t, 1, "|cfffed000La Croisade \195\137carlate|r", "CENTER", 3)
tip:AddLine("Helloz", "World", "Texts")
tip:SmartAnchorTo(self)
tip:Show()
end
end
local function OnLDBLeave(self)
if _.db.profile.showtooltip then
TIP:Release(self.tooltip)
self.tooltip = nil
end
end
this codes appears the way I want on the second mouseover but never the first one :(
//edit: figured out when commenting AddLine() this is displayed fine one first OnEnter, but when adding new line with cells below my colspan-ed headers its not displayed well on first onenter but on the second one, I think there is a bug when displaying it first I saw a similiar bug in tistanian's mod broker factions
Afaik, CowTip and similar tooltip addons are used to manipulate the GameTooltip. LibQTip creates its own and the initial border/background/alpha/scale/strata/colors are hardcoded in the lib to match the default ones used by the GameTooltip. If you want to change them you will need to do so by using your addon's tooltip frame and relevant methods after the tooltip has been acquired (and imo populated). You should be able to keep font settings though.
I now run the following function just prior to Show():
Works like a charm!
I have to wonder though, if this sort of thing might be included in LibQTip at some point though. That way any addon that uses it will fit in with everything else when skinning/theming addons are in use? Something to think about, anyhow.
Maybe the code that copies these from the GameTooltip in the first place could be moved over to the beginning of the Show() code or something?
Actually this code is interesting :p Let's see what the rest think about it.
Yay, now all my QTip addons will be pretty! <3 <3
I don't. We wanted QTips to look like GameTooltip from the beginning. However it might have some funny behavior if the GameTooltip had a funny state when we acquire the tooltip.
And then there's the use of QTip for non-tooltip frames, that darn column functionality is just so tasty. :)
On another matter, is it possible to merge 2 cells? I have a 2 column layout, in my tooltip, but I want my "Click to configure" text to sit in a cell that spans the entire row.
What do you mean? LibQTipClick has exactly the same lifetime properties as LibQTip.
Yes:
Oh, I was just making a casual assumption about how we might use these libraries. Tooltips only visible on mouse-over, and it's usually useful morsel of information and nothing more. You could use LibQTipClick for menus and things requiring actual interaction, therefore it's uses are probably going to be more prolonged.
If the snapshot of GameTooltip properties is fishy, then you'll only notice it for the one tooltip (assuming it is momentary). It takes longer to use a menu (in theory) so the ugliness would be less brief.
And thanks for the code. <3
And for code that's more correct to your purpose:
I tried setting my HideTooltip callback to the tooltip's OnLeave, but this seems to fire when the mouse enters a cell. I suppose the mouse has technically left the tooltip and now inhabits an internal frame instead. Any chance we can get this behaviour changed? Or I could just be on crack.
Should I just put a "Close" cell somewhere and get people to click it to dispose of the tooltip? Seems sort of yucky.
I eventually want to have the primary tooltip spawn a little baby tooltip off to the side somewhere for certain cells.
I've noticed that the tooltip is only cleared now if I move the mouse slow enough to pass through the outer frame first. Too fast, and the event doesn't happen. It's weird. I'm going to mess about more with the callbacks and see if I can wrangle together something better.
Also, I don't have any callbacks for any of the cells set. When I click the cells, I get a message in the chat window from LibQTipClick. I suppose I'll have to register callbacks to quiet it?
I actually don't want most of the cells to do anything, just a few of them. Is there a way to disable the mouseover highlight effect (on a per-cell basis would be nice)?
I've noticed that the tooltip is only cleared now if I move the mouse slow enough to pass through the outer frame first. Too fast, and the event doesn't happen. It's weird. I'm going to mess about more with the callbacks and see if I can wrangle together something better.
Also, I don't have any callbacks for any of the cells set. When I click the cells, I get a message in the chat window from LibQTipClick. I suppose I'll have to register callbacks to quiet it?
I actually don't want most of the cells to do anything, just a few of them. Is there a way to disable the mouseover highlight effect (on a per-cell basis would be nice)?
Just noticed that even when using AddNormalLine() and AddNormalHeader(), as soon as you use SetCell() you get an interactive cell. If there isn't another way to disable this behaviour, perhaps a SetNormalCell() routine is called for?
below is how looks like my tip
this codes appears the way I want on the second mouseover but never the first one :(
//edit: figured out when commenting AddLine() this is displayed fine one first OnEnter, but when adding new line with cells below my colspan-ed headers its not displayed well on first onenter but on the second one, I think there is a bug when displaying it first I saw a similiar bug in tistanian's mod broker factions