Thread Tools Display Modes
12-25-09, 11:33 AM   #1
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Map icons and widgets handlers

Hello, for my addon I would like to create map and minimap icons and then apply some handlers (OnClick, OnEnter, OnLeave).
I've got no problem with creating icons, but none of the handlers works for these icons except the OnClick handler with the minimap icons.
I watched at TomTom's code and FindYourWay's code and they seem to work well, but I don't know why it doesn't work with me.

So I would like to know if you guys know a way to make this work. The code used is available here

Thanks in advance
__________________
  Reply With Quote
12-25-09, 01:27 PM   #2
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 154
At a glance, it looks like the OnEnter/OnLeave handlers are getting called but aren't setting the tooltip up right. Make sure to set the tooltip's owner to your minimap button, and you'll also need to clear the previous tooltip lines before adding your own. This OnEnter code might work:
Code:
local function OnEnter(self)
	GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT");
	GameTooltip:SetText(self.type); -- This clears the tooltip implicitly
end

Last edited by Saiket : 12-25-09 at 01:34 PM.
  Reply With Quote
12-26-09, 03:35 AM   #3
Soeters
A Warpwood Thunder Caller
 
Soeters's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 97
Thanks that worked well on the minimap icons.

In order for this to work on map icons I had to change the frame strata to "HIGH" because WorldMapDetailFrame has a "MEDIUM" strata.

Problem solved
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Map icons and widgets handlers


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