Panel:SetTooltip(tip) not working on spawnicon.

I’m setting the tooltip in a cursorentered hook, and nothing happens. I’ve tried think as well. The tooltip just shows the model path.

Am I doing something wrong? The string prints in the console as it should.

[LUA]
SpawnIcons*.OnCursorEntered = function(self)
if not self.SlotItem then return end
local tooltiptext = Items[self.SlotItem].name or nil
tooltiptext = tooltiptext…"
“…Items[self.SlotItem].desc…”

"
for k,v in pairs(Items[self.SlotItem].tags)do
tooltiptext = tooltiptext…v…", "
end
tooltiptext = string.Left(tooltiptext, string.len(tooltiptext)-2)
print("

"…tooltiptext)
self:SetTooltip( tooltiptext or “ERROR[ NO INFO FOR ITEM: “…self.item…” ]”)
end
[/LUA]

prints:

"Water
A bottle of purified water. Provides hydration.

Consumable, Drink"

on mouse-over.

Why are you setting it when you mouse over it? You should be setting it when you create the icon.

The icon has dynamic content.
I figured it out though. Setting the model automatically sets the tooltip to the model name. You have to set the tooltip after that.