WoWInterface - View Single Post - HOWTO: Integrate your addon with Clique (under Cataclysm/4.x)
View Single Post
10-14-10, 06:03 PM   #7
A Murloc Raider
Join Date: Apr 2009
Posts: 5
OK, I got it mostly working. Here's what I have done.

My Party Frame had to inherit from both SecurePartyHeaderTemplate and SecureHandlerBaseTemplate.

Now I could do the Frame:SetFrameRef("clickcast_header", ClickCastHeader)";

I updated the initialConfigFunction as an attribute and used the following snippet for the value.

local header = self:GetParent():GetFrameRef("clickcast_header")
-- do not add this conditional in without testing, it will allow for incorrect
-- integration, so you should verify it works before adding this check.
if header then
header:SetAttribute("clickcast_button", self)

My template for my unit button also needed to inherit from both SecureUnitButtonTemplate and SecureHandlerEnterLeaveTemplate.

I added the following attributes to the template also.

<Attribute name="_onenter" type="string" value="local snippet = self:GetAttribute('clickcast_onenter'); if snippet then self:Run(snippet) end"/>
<Attribute name="_onleave" type="string" value="local snippet = self:GetAttribute('clickcast_onleave'); if snippet then self:Run(snippet) end"/>

The only problems I have left are as follows.

How do I get the new buttons that are created into the ClickCastFrames table? The buttons are generated dynamically by SecurePartyHeaderTemplate and I don't get "notified" until the initialConfigFunction snippet is processed. I'm going to try to add it to the snippet but I'm not sure if that will work.

Also I can't seem to get the menu to work on my buttons. The menu works on the stock UI frames.
  Reply With Quote