Assuming you wanted to make a table of buttons then yes you are doing it right. However, just in case I would add the following line just above this one :
LeftScrollBar.scrollChild.button[bnid] = CreateFrame('button', "HHeaderButton" .. bnid, LeftScrollBar.scrollChild)
LeftScrollBar.scrollChild.button = LeftScrollBar.scrollChild.button or {}
Then assuming bnid is a value it will give the table an index linked list of buttons.
To access you would do something like:
LeftScrollBar.scrollChild.button[1] and not LeftScrollBar.scrollChild.button1 unless that is something in tables I haven't come across yet.
|