From 442ea090d3f902d1d9387926c5a0387d2a64b73f Mon Sep 17 00:00:00 2001 From: Insality Date: Mon, 21 Sep 2020 01:12:31 +0300 Subject: [PATCH] Add grid:get_nodes function --- druid/base/static_grid.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/druid/base/static_grid.lua b/druid/base/static_grid.lua index 64ab912..e9ffbaa 100644 --- a/druid/base/static_grid.lua +++ b/druid/base/static_grid.lua @@ -27,7 +27,7 @@ local Event = require("druid.event") local helper = require("druid.helper") local component = require("druid.component") -local M = component.create("grid", { const.ON_LAYOUT_CHANGE }) +local M = component.create("static_grid", { const.ON_LAYOUT_CHANGE }) --- Component init function @@ -222,7 +222,7 @@ function M.add(self, item, index) end ---- Remove the item from the grid. Node that gui node will be not deleted +--- Remove the item from the grid. Note that gui node will be not deleted -- @function static_grid:remove -- @tparam number index The grid node index to remove -- @tparam bool is_shift_nodes If true, will shift nodes left after index @@ -317,4 +317,13 @@ function M.clear(self) end + +--- Return the grid nodes table +-- @function static_grid:get_nodes +-- @treturn table The grid nodes +function M.get_nodes(self) + return self.nodes +end + + return M