mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Basic examples done
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
---@field blocker druid.blocker
|
||||
local M = {}
|
||||
|
||||
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
|
||||
@@ -12,12 +13,26 @@ function M:init()
|
||||
self.button = self.druid:new_button("button/root", self.on_button_click)
|
||||
end
|
||||
|
||||
|
||||
function M:on_root_click()
|
||||
print("Root click")
|
||||
end
|
||||
|
||||
|
||||
function M:on_button_click()
|
||||
print("Button click")
|
||||
end
|
||||
|
||||
|
||||
---@param output_log output_list
|
||||
function M:on_example_created(output_log)
|
||||
self.button_root.on_click:subscribe(function()
|
||||
output_log:add_log_text("Root Clicked")
|
||||
end)
|
||||
self.button.on_click:subscribe(function()
|
||||
output_log:add_log_text("Button Clicked")
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user