View Single Post
10-07-14, 11:00 AM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Ok, I got this working now. It's even more complicated and stupid than I thought.

"type/click" expects a object in "clickbutton". It doesn't work with a frame name. :/
In my secure code PetActionButtonx obv. isn't a valid reference.
So I tried to pre-set a frame reference via unsecure code. Like
Lua Code:
  1. BABHeader:SetFrameRef("PetActionButton1", _G["PetActionButton1"])
Then I tried to use this in my secure code:
Lua Code:
  1. local tbutton = self:GetFrameRef("BABHeader"):GetFrameRef("PetActionButton1")
  2. print(tbutton:GetName())
  3. self:SetAttribute("type2", "click")
  4. self:SetAttribute("clickbutton2", tbutton)
Which printed the string "PetActionButton1" and as a total surprise triggered the error
6x FrameXML\SecureTemplates.lua:542: attempt to call method "IsForbidden" (a nil value)
on a right click.

Must be another bug within the secure button stuff (see http://www.wowinterface.com/forums/s...493#post297493)
Seems as I have to set the clickbutton2/frameref thing via unsecure code. :/

Last edited by Duugu : 10-07-14 at 11:12 AM.
  Reply With Quote