mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update examples to widgets instead components
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
---@class examples.basic_text: druid.component
|
||||
---@field druid druid.instance
|
||||
---@class examples.basic_text: druid.widget
|
||||
---@field text druid.text
|
||||
local M = component.create("basic_text")
|
||||
|
||||
---@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.text = self.druid:new_text("text")
|
||||
|
||||
-- This code is for adjustable text area with mouse
|
||||
|
@@ -1,16 +1,10 @@
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
---@class examples.multiline_text: druid.component
|
||||
---@class examples.multiline_text: druid.widget
|
||||
---@field root node
|
||||
---@field druid druid.instance
|
||||
local M = component.create("multiline_text")
|
||||
|
||||
---@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.root = self:get_node("root")
|
||||
self.text = self.druid:new_text("text")
|
||||
|
||||
|
Reference in New Issue
Block a user