WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Tabbed Windows Problem (https://www.wowinterface.com/forums/showthread.php?t=1472)

cs01pj 08-10-05 04:05 PM

Tabbed Windows Problem
 
Hi,
I'm struggling to get this tutorial to work @ http://www.wowwiki.com/Advanced_Tuto...Tabbed_Windows.

I followed the tutorial to the word, but he does not show the myButtonHandler(this:GetName()); method in lua. I think this may be where my problem lies. I've spent days looking at the source code of UIPanelTemplates.LUA in the FrameXML dir. But still having trouble.

Any help showing some code snippets of how to get the tabs to work would be great. Just so I can swap between frames.

Please any help would be greatly appreciated :) !!

farang 09-08-05 05:17 AM

Okay, maybe i can help.

I'm not at home right now ,so i can't do any testing ,but the function you want to create has to work like this:

1. extract the number from the Button pressed.

if you specify the "id" for the button ,then you can easily get it by:

local id = this:GetID();

(do a DEFAULT_CHAT_FRAME:AddMessage("ID:" .. id) for dump out the value for testing)

2. the "Hidding" part.

if you wrapped all your elements (buttons, fontstrings) inside one <frame> element ,it's easy.

For example your Frame with all the content for Page 1 is called "FramePage1", then you do something like this:

if (id == 1) then
FramePage1:Show()
FramePage2:Hide()
FramePage3:Hide()
end
if (id == 2) then
FramePage1:Hide()
FramePage2:Show()
FramePage3:Hide()
end

If you need to know how you can nest the elements inside a Frame, you can check this:

http://fara.webeddie.com/ui/


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

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