[Rseding91] Missing doc: return value of LuaGuiElement::add
Posted: Fri Sep 02, 2016 5:38 am
After a long struggle and then a sudden curiosity, I realized that
LuaGuiElement::add actually returns the added GUI element!
So, instead of doing something like
you can do it like this:
It is a huge difference if you are adding many GUI elements.
Some of you may have already known this, but this deserves to be on the document.![Razz :P](./images/smilies/icon_razz.gif)
LuaGuiElement::add actually returns the added GUI element!
So, instead of doing something like
Code: Select all
frame.add{type = "table", name = "my_table", colspan = 10}
local my_table = frame["my_table"]
my_table.add{.......}
Code: Select all
local my_table = frame.add{type = "table", name = "my_table", colspan = 10}
my_table.add{.......}
Some of you may have already known this, but this deserves to be on the document.
![Razz :P](./images/smilies/icon_razz.gif)