Update examples to widgets instead components

This commit is contained in:
Insality
2025-03-27 00:19:32 +02:00
parent dee77ab313
commit 7640e207a4
47 changed files with 183 additions and 422 deletions

View File

@@ -1,17 +1,10 @@
local component = require("druid.component")
---@class examples.scroll_slider: druid.component
---@class examples.scroll_slider: druid.widget
---@field root node
---@field scroll druid.scroll
---@field slider druid.slider
---@field druid druid.instance
local M = component.create("scroll_slider")
---@param template string
---@param nodes table<hash, node>
function M:init(template, nodes)
self.druid = self:get_druid(template, nodes)
local M = {}
function M:init()
self.scroll = self.druid:new_scroll("scroll_view", "scroll_content")
self.scroll.on_scroll:subscribe(self.on_scroll)