1. I'm trying to set up a button similar to you Quick Caster Button but only needs to cast on a single click. It casts the spell just fine, but it doesn't look right.

    It shows the light blue edge effect when the mouse is in the frame, but not the bigger edge effect that shows when a normal action button is clicked.

    I've tried various combinations of either defining it in xml or using SetNormalTexture() and SetPushedTexture()

    In fact, if I call EdmFrameSpell:SetNormalTexture("INTERFACE\ICONS\spellwarlock_focusshadow") from OnLoad, I get a giant icon on top of the button instead of the sized defined by xml.

    Any idea what I am leaving out?

    Thanks, Andy

     <Button name="$parent_Spell" inherits="ActionButtonTemplate, SecureActionButtonTemplate" frameStrata="HIGH" hidden="false">
        <Size x="48" y="48"/>
        <Anchors>
            <Anchor point="RIGHT" relativePoint="RIGHT"/>
            <Offset x="-200" y="0"/>
        </Anchors>
    
        <NormalTexture file="INTERFACE\ICONS\spell_warlock_focusshadow"/>
        <PushedTexture file="INTERFACE\ICONS\spell_warlock_focusshadow"/>
    
        <Attributes>
            <Attribute name="type"  type="string" value="spell"/>
            <Attribute name="spell" type="string" value="Dark Intent"/>
        </Attributes>
       <Scripts>
        <OnLoad function="EdmButton_OnLoad"/>
        </Scripts>
     </Button>
    

    I mean, I'm looking at such a narrow view, I don't know what to tell you. I only have a part of the code, don't have any screenshots, and dont' have any idea how the overall addon is organised. Can you provide some more information?

    Well, there's really not much more to it to demonstrate the issue, but here it goes. This will put an Auto Attack button in the middle of a frame. If you float your mouse over it, the edges highlight, just like an action bar button from which it is derived. But if you click an action bar button, you get a much brighter edge effect compared to the mouse enter highlight while the button is pushed.

    I don't think the pushed icon is a different icon since there does not appear to be a different set of normal / pushed icons in the interface directory.

    If you try and use GetSpellInfo() to get the class specific auto attack icon and then set it using SetNormalTexture(icon) it overwrites the entire frame, but I can't figure out why.

    The button auto attacks just fine, the problem is completely with the display using the template.

    Thanks, Andy

    ButtonTest.toc

     ## Interface: 40200
     ## Title: ButtonTest
     ButtonTest.lua
     ButtonTest.xml
    

    ButtonTest.xml

     <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
         <Frame name="ButtonTest" hidden="false" toplevel="true" frameStrata="HIGH" enableMouse="true" movable="true" parent="UIParent" clampedToScreen="true">
             <Size x="100" y="100"/>
             <Anchors>
                 <Anchor point="CENTER"/>
             </Anchors>
                    <Backdrop bgFile="Interface\TutorialFrame\TutorialFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
                        <EdgeSize>
                            <AbsValue val="24"/>
                        </EdgeSize>
                        <TileSize>
                            <AbsValue val="24"/>
                        </TileSize>
                        <BackgroundInsets>
                            <AbsInset left="5" right="5" top="5" bottom="5"/>
                        </BackgroundInsets>
                    </Backdrop>
                    <Layers>
                        <Layer level="ARTWORK">
                            <FontString name="$parentText" inherits="GameFontWhite">
                                <Anchors>
                                    <Anchor point="TOP">
                                        <Offset x="0" y="-10"/>
                                    </Anchor>
                                </Anchors>
                            </FontString>
                            <FontString name="$parent_TargetName" inherits="GameFontWhite">
                                <Anchors>
                                    <Anchor point="TOP" relativeTo="$parentText" relativePoint="BOTTOM">
                                    <Offset y="-4"/>
                                    </Anchor>
                                </Anchors>
                            </FontString>
                        </Layer>
                    </Layers>
                    <Frames>
                        <Button name="$parent_Spell" inherits="ActionButtonTemplate, SecureActionButtonTemplate" frameStrata="HIGH" hidden="false">
                                <Size x="64" y="64"/>
                                <Anchors>
                                    <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER">
                                    </Anchor>
                                </Anchors>
    
                            <NormalTexture file="Interface\Icons\inv_knife_1h_cataclysm_b_02"/>
                            <PushedTexture file="Interface\Icons\inv_knife_1h_cataclysm_b_02"/>
    
                                <Attributes>
                                    <Attribute name="type"  type="string" value="spell"/>
                                    <Attribute name="spell" type="string" value="Auto Attack"/>
                                </Attributes>
                                <Scripts>
                                    <OnLoad function="ButtonTest_OnLoad"/>
                                </Scripts>
                        </Button>
                    </Frames>
                <Scripts>
                    <OnMouseDown>
                        if ( button == "LeftButton") then
                            self:StartMoving();
                            self.isMoving = true;
                        end
                    </OnMouseDown>
                    <OnMouseUp>
                        if ( self.isMoving ) then
                            self:StopMovingOrSizing();
                            self.isMoving = false;
                        end
                    </OnMouseUp>    
                    <OnHide>
                        if ( self.isMoving ) then
                            self:StopMovingOrSizing();
                            self.isMoving = false;
                        end
                    </OnHide>
                </Scripts>
            </Frame>
     </Ui>
    

    ButtonTest.lua

     function ButtonTest_OnLoad()
    local name, rank, icon = GetSpellInfo("Auto Attack")
    --remove comments below to put huge texture that cover whole frame rather than just the button
    --ButtonTest_Spell:SetNormalTexture(icon)
    --ButtonTest_Spell:SetPushedTexture(icon)
    
       ButtonTest_Spell:SetAttribute("unit", "target")
     end
    

    Additionally, I've tried inheriting from ActionBarButtonTemplate. That gets me the GCD sweep and flash, but still not the pressed highlight. Don't really want that, would prefer to inherit from ActionButtonTemplate, and SecureActionButtonTemplate.

    I've also tried declaring it as a CheckButton, but that changed nothing.

    local n, r, icon = GetSpellInfo(idarkintents) Putting _G[button:GetName()]:SetTexture(icon)

    seems to set the icon without the weird resizing issue, but still won't get the pushed highlight... Argh.

    Don't set NormalTexture or PushedTexture in the XML. That's precisely your problem. And your latest post shows exactly WHY.

    You're inheriting from ActionButtonTemplate. A glance at that XML code shows precisely what you're inheriting. You get an icon, the flash, flyout border, shadow, flyout arrow, name, border, cooldown, and normal/highlight/pushed textures.

    Remove your texture overrides, and set the icon accordingly.

     function ButtonTest_OnLoad()
        local name, rank, icon = GetSpellInfo("Auto Attack")
        ButtonTest_Spell.icon:SetTexture(icon)
        ButtonTest_Spell:SetAttribute("unit", "target")
     end
    

    You shouldn't be using pushed textures at ALL unless you know what you're trying to do with them. Always make sure you understand the template you are inheriting from, don't just do it blindly!

    Thank you, that did it.

    I see where it comes from now. But I didn't connect the dots. I was comprehending "texture" to mean the string such as "/Interface/Icon/blahblahblah" rather than an object into which that information is stored.

     <Layer level="BACKGROUND">
         <Texture name="$parentIcon" parentKey="icon"/>
     </Layer>
    

    Now I see that each thing that has a parentKey can be accessed with object.parentKey.someMethod()

    You can look it up by name rather than using the parentKey, since not all templates have this attribute set.