WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Need Help with Buttons (https://www.wowinterface.com/forums/showthread.php?t=33454)

mog 06-25-10 03:14 AM

Need Help with Buttons
 
Ok im a Newbie in Lua and i have a problem to copy a Button.

I create a Button with:

local newbutton = CreateFrame("Button", "NewButton", Frame1, "ActionButtonTemplate")
newbutton:SetPoint("TOP")
newbutton:SetBackdrop({bgFile = select(3, GetSpellInfo(2484))})
newbutton:SetFrameLevel(Frame1:GetFrameLevel() + 1)

ok that works fine

Now i want to copy this button to an existing Button.

This dosnt work for me.
existingButton = newbutton

How can i copy an button to another Button???
Thanx for any help.

v6o 06-25-10 04:05 AM

If you mean changing the exisiting variable to point to the new button then you've done it but as far as I know you can't replace frames with the same frame name.

you use newbutton at the start then airbutton at the end, make sure you're doing it right.

mog 06-25-10 04:17 AM

Ok Copy and Past error...

I mean:
existingButton = newbutton

Nothing happens... no error no switching of the buttonlayout

existingButton and newbutton don't have the same name...

mog 06-25-10 04:59 AM

Ok i think
existingButton = newbutton works partielle

The name of the existingButtons are switching but the Icon doesn't change.
Why??

v6o 06-25-10 05:18 AM

To provide further help; please explain what are you trying to do


All times are GMT -6. The time now is 07:50 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI