The titel is perhaps a little overdue to the actual problem. Here is the situation. I am working on my Gui and it is time for me to create a dropdown button. (you might have notice the status update )
I want to create this Gui so that it is really easy accesible and easy to understand for everyone. Basicly said: a Dropdown button actually exists out of multiple normal buttons (with normal, hover and mousedown mode). What I hope to achieve is something like the code beneath.
dropdown1 = LuaGui.CreateDropDown(2) -- number of rows is filled in as a parameter
dropdown1:SetImages("abstract::normal.dds","abstract::hover.dds")
dropdown1.row1:SetImages("abstract::normal.dds","abstract::hover.dds")
dropdown1.row2:SetImages("abstract::normal.dds","abstract::hover.dds")
As you can see, row1 and row2 members of the dropdown button that is created.
In the Gui code itself I have this:
function LuaGui.CreateDropDown(rows)
local o = {}
setmetatable(o, LuaGui)
--rows
o.row = {}
for n=1,rows do
o.row[n] = LuaGui.CreateButton()--Create a basic button for every row.
end
return o
Any suggestions?