Thread Tools Display Modes
07-03-07, 03:11 PM   #1
Saiiyna
An Aku'mai Servant
 
Saiiyna's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 33
My buttons dont go away with alt-z

This is the xml for the button:

<Button name="HB_ButtonTemplate1" movable="true" hidden="true" enableMouse="true" inherits="SecureActionButtonTemplate" toplevel="true" parent="UIParent" virtual="true">
<NormalTexture file="Interface\AddOns\HealerButtons\Heal.tga"/>
<HighlightTexture alphaMode="ADD" file="Interface\AddOns\HealerButtons\Heal.tga"/>
<Size>
<AbsDimension x="18" y = "18"/>
</Size>
<Scripts>
<OnLoad>
this:RegisterForClicks("LeftButtonUp","RightButtonUp","MiddleButtonUp");
this:RegisterForDrag("LeftButton");
</OnLoad>
</Scripts>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="PlayerFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="5" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</Button>

<Button name="HB_playerButton1" inherits="HB_ButtonTemplate1,SecureActionButtonTemplate">
<Attributes>
<attribute name="unit" value="player" />
</Attributes>
<Scripts>
<OnEvent>
HB_OnEvent(event);
</OnEvent>
<OnMouseUp>
HB_OnDragStop(this);
</OnMouseUp>
<OnDragStart>
HB_OnDragStart(this);
</OnDragStart>
<OnDragStop>
HB_OnDragStop(this);
</OnDragStop>
<OnLoad>
this:RegisterForClicks("LeftButtonUp","RightButtonUp","MiddleButtonUp");
this:RegisterForDrag("LeftButton");
HB_OnLoad();
</OnLoad>
<OnEnter>
HB_MakeTooltip(this,"ANCHOR_CURSOR")
</OnEnter>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
<Layers>
<Layer level="BACKGROUND">
<Texture>
<Color r="1" g=".2" b=".2" a="0.5" />
</Texture>
</Layer>
</Layers>
</Button>

when I hit Alt-z they stay on the screen. Can someone tell me how to make them go away with alt-z please.


Saii
 
05-03-10, 05:09 AM   #2
Cidwel
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 23
... I'm not sure if you can do this

<Button name="HB_playerButton1" inherits="HB_ButtonTemplate1,SecureActionButtonTemplate">

I think you need inherit the button to the HB_ButtonTemplate1 and ButtonTemplate1 should inherit from secureActionButtonTemplate, I think you can't inherit more than one frame.

Try this. In the button (not the template) replace the definition from this one:
<Button name="HB_playerButton1" inherits="HB_ButtonTemplate1">

It will inherit from SecureActionButtonTemplate since you have inherit from a frame that inherits from SecureActionButtonTemplate

My bad, I've revived an old post
 
05-03-10, 06:42 AM   #3
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
The buttons need a parent that is UIParent.
Only frames with parent UIParent are hidden.

When yours are not hidden I guess the parenting does not work as expected.
__________________
The cataclysm broke the world ... and the pandas could not fix it!

Last edited by Rilgamon : 05-03-10 at 06:44 AM.
 

WoWInterface » Developer Discussions » Lua/XML Help » My buttons dont go away with alt-z


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off