I am wondering if there is a way to display a hyperlink's contents in a wow UIDropDown. Normally using a gametooltip this is easy enough...but the UIDropDown doesn't give you the option to use a hyperlink. Is there a way to do this?? Thanks in advance -
sample code --
for k in pairs(ITEM_LIST[1]) do
info = UIDropDownMenu_CreateInfo()
local name,link,rest = GetItemInfo(k);
info.text = link .. " x"..getNumberOfItems(k);
info.value = k
info.tooltipTitle = name; --TODO how to make these into hyperlink data?
info.tooltipText = link; --TODO ^^^
info.tooltipOnButton = true;
info.func = OnAuctionDropDownClick
UIDropDownMenu_AddButton(info, level)
end
SS of current versus what I'd like it to look like--
You could try
- hooking the OnEnter script of the dropdownmenu buttons
- check that the parent of the button is "your" dropdown
- and do a GameTooltip:SetHyperlink(itemlink)
I haven't done this anywhere and I don't think it's worth the trouble tbh.
He's not asking how to have the tooltip show without having Beginner Tooltips enabled.
There's a new flag info.tooltipOnButton which you can use to show tooltips regardless, so Xinhuan's workaround is no longer needed (and additionally won't even work because in 4.3 GameTooltip_AddNewbieTip is not called if the flag is set)
OP's sample code already uses that flag.
Adding the OnEnter handler from 4.3 for reference
<OnEnter>
if ( self.hasArrow ) then
local level = self:GetParent():GetID() + 1;
local listFrame = _G["DropDownList"..level];
if ( not listFrame or not listFrame:IsShown() or select(2, listFrame:GetPoint()) ~= self ) then
ToggleDropDownMenu(self:GetParent():GetID() + 1, self.value, nil, nil, nil, nil, self.menuList, self);
end
else
CloseDropDownMenus(self:GetParent():GetID() + 1);
end
_G[self:GetName().."Highlight"]:Show();
UIDropDownMenu_StopCounting(self:GetParent());
if ( self.tooltipTitle ) then
if ( self.tooltipOnButton ) then
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:AddLine(self.tooltipTitle, 1.0, 1.0, 1.0);
GameTooltip:AddLine(self.tooltipText);
GameTooltip:Show();
else
GameTooltip_AddNewbieTip(self, self.tooltipTitle, 1.0, 1.0, 1.0, self.tooltipText, 1);
end
end
</OnEnter>
sample code --
SS of current versus what I'd like it to look like--
You could try
- hooking the OnEnter script of the dropdownmenu buttons
- check that the parent of the button is "your" dropdown
- and do a GameTooltip:SetHyperlink(itemlink)
I haven't done this anywhere and I don't think it's worth the trouble tbh.
http://forums.wowace.com/showpost.php?p=290216&postcount=23
Yes... no :p
He's not asking how to have the tooltip show without having Beginner Tooltips enabled.
There's a new flag info.tooltipOnButton which you can use to show tooltips regardless, so Xinhuan's workaround is no longer needed (and additionally won't even work because in 4.3 GameTooltip_AddNewbieTip is not called if the flag is set)
OP's sample code already uses that flag.
Adding the OnEnter handler from 4.3 for reference
but from the looks of it the hook could be modified instead to use the GameTooltip's OnShow script instead of the hook to GameTooltip_AddNewbieTip