Quantcast Frame iteration question - WoWInterface
Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-14-12, 03:20 PM   #1
A Defias Bandit
Join Date: Nov 2012
Posts: 2
Frame iteration question

Hello, I have a question on frame iteration and LUA scope (I am quite new to LUA). What I want to do is make a function that creates a bunch of child frames that connect to the parent frame and shoves them in a table but I haven't been able to make my attempts work. The reason I'd like to have a table is so that I can then iterate over them easily and change attributes.

Code below:

local frame = createframe('frame', 'frame', UIPARENT)
local frameCache = {}

local function = frameInit(name, x)
--make movable, allow mouse interaction, call makeMiniFrame x number of times

--relevent portion
   for i = 1, x, 1 do
      makeMiniFrame("frame" .. i, frame)
      table.insert(frameCache, "frame" .. i)

local makeMiniFrame, otherFrameFunction
   makeMiniFrame = function(name, parent)
      local f = CreateFrame('Frame', name, parent)
      return f

   otherFrameFunction = function(name)
      if name then
         f = name
      f: --dostuff to frame
   return f

Is this the correct way of approaching this or am I completely off base?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Frame iteration question

Thread Tools
Display Modes

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