View Single Post
  #5  
Unread 10-22-2011, 11:53 PM
itsallhype820 itsallhype820 is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Oct 2011
Posts: 8
garan is right about the data scope. i think it would be a better idea to do what you are trying to do by, making a class that contains your top level info. so say you want an array of a certain window. a class holding this info could be like (im doing this off the top of my head so bare with me.

cont = class()
function cont:Cunstructor()

self.winList = {}
end
function cont:addWindow(winObj, nameOf)

self.winList[nameOf] = winObj
end
function cont:getWindow(nameOf)
return self.winList[nameOf]
end
this is just a very simple example.. of how to maintain a collection of objects. nameOf can be a string like "title window" or you can make it interger base where it is 1 2 3 4 etc.

so to use just do , myContainer = cont()
--my window is a window class that you have made just make a new instance of it then pass it
myContainer:addWindow(myWindow, "Main")

to set data or grab position etc use
local tempWindow = myContainer:getWindow("Main")
local x, y = tempWindow:GetPosition()

hope this makes some sense. ideally you would use your container class with self.mainWin = yourWindow in the constructor to save it in the class for future reference
__________________
LOTRO
50 burglar , 23 cap, 23 hunter, 23 gaurd, 23 lm, 23 champ

WoW
85 every class alliance , addon author and power leveling guide author (yes, i know way to much time on my hands ... but but i started when vanilla hit retail if that makes it any better ha )

AoC
65 bear shaman-wiccana (lvling guide contributor)

RL
Web and Desktop application dev and dad now
Reply With Quote