-
Posted by jumxipel on Wed, 20 Jun 2012 18:13:41
Hi, everybody. As to me to fix on a frame a macro? On a frame it is possible to fix buttons and how me for a place of buttons to put a macro?
I created "Hello World" macro with the text of "Hello world" and how me a macro to place on a frame?
I need to add a macro on a frame.
-
Posted by jnwhiteh on Thu, 21 Jun 2012 10:09:59
You can use a secure action button with the "macro" type. You can likely find either of these in the index to locate the appropriate chapter.
-
Posted by jumxipel on Thu, 21 Jun 2012 13:17:25
You can use a secure action button with the "macro" type. You can likely find either of these in the index to locate the appropriate chapter.
Forgive I you I do not understand. In the book isn't present about it.
Or how to start to me a macro through:
frame:SetScript("OnClick", function() .... end)
-
Posted by jnwhiteh on Thu, 21 Jun 2012 21:21:18
Second edition, starting at page 289. It is most certainly covered. You use the "macrotext" attribute, with the value being the text of the macro you want to run.
PlayerFrame:SetAttribute("CTRL-SHIFT-type1", "macro") PlayerFrame:SetAttribute("macrotext", "/say Hello")
Or something like that.
-
Posted by jumxipel on Thu, 21 Jun 2012 21:40:47
Second edition, starting at page 289. It is most certainly covered. You use the "macrotext" attribute, with the value being the text of the macro you want to run.
PlayerFrame:SetAttribute("CTRL-SHIFT-type1", "macro") PlayerFrame:SetAttribute("macrotext", "/say Hello")
Or something like that.
Doesn't work. How it is correct?
test = CreateFrame("Button",nil,UIParent,"OptionsButtonTemplate") test:Enable(true) test:SetWidth(67) test:SetHeight(22) test:SetText("Test") test:SetPoint("CENTER",UIParent,-120,95) test:SetAttribute("CTRL-SHIFT-type1", "macro") test:SetAttribute("macrotext", "/say Hello")
-
Posted by jnwhiteh on Thu, 21 Jun 2012 22:18:43
Read the chapter. Run the example. I'm not going to re-write the entire contents of the chapter here. I'll reiterate my first response.
You need to use the macrotext action for a SecuteActionButton. The examples in the book show precisely how to do this.
In short, make sure you inherit from the SecureActionButton template.