Talk:SecureActionButtonTemplate

From Warcraft Wiki
Jump to navigation Jump to search

Wrong page name

This page seems to be only about the secure action button template, not about all secure frames -watchout 11:29, 12 September 2007 (UTC)

macrotext

I don't know if it's a problem with my code or what, but I couldn't get this to work:

frame:SetAttribute("type", "macro")			
frame:SetAttribute("macrotext", macrotextvar)

I had to do it like this:

frame:SetAttribute("type", "macro")			
frame:SetAttribute("macro", false)
frame:SetAttribute("macrotext", macrotextvar)

Posted by: EGingell (T|C|F) on 09:10, 15 November 2007 (UTC)

HRm... I use macrotext the way you describe in the first example in more than one addon... might have to doublecheck they still work. Perhaps the frame you're modifying already had the "macro" attribute set? User:Tekkub/Sig 09:17, 15 November 2007 (UTC)
The frame was created on the fly. I can't, for the life of me, figure out where the problem is. When I clicked on said button, it fired RunMacro() with "frame.name" instead of the "macrotext" attribute. I tried changing the name of the property from "frame.name" to "frame.title" and it still tried to fire RunMacro() with the same frickin' value. The only thing that I can think of is that, somehow, somewhere, frame:SetAttribute("macro", whatever) was being called implicitly and, since FrameXML\SecureTemplates.lua checks for the "macro" attribute first, my "macrotext" wouldn't ever fire. Posted by: EGingell (T|C|F) on 09:51, 15 November 2007 (UTC)