mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Add component instance with general methods. New component constructor
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
--- Radio group module
|
||||
-- @module base.checkbox_group
|
||||
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.system.component")
|
||||
|
||||
local M = {}
|
||||
local M = component.new("radio_group")
|
||||
|
||||
|
||||
local function on_checkbox_click(self, index)
|
||||
@@ -12,7 +12,7 @@ local function on_checkbox_click(self, index)
|
||||
end
|
||||
|
||||
if self.callback then
|
||||
self.callback(self.context, index)
|
||||
self.callback(self:get_context(), index)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ end
|
||||
|
||||
|
||||
function M.init(self, nodes, callback, click_nodes)
|
||||
self.druid = helper.get_druid(self)
|
||||
self.druid = self:get_druid()
|
||||
self.checkboxes = {}
|
||||
self.callback = callback
|
||||
|
||||
|
Reference in New Issue
Block a user