mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Add on_change_value to input property widget
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
local event = require("event.event")
|
||||
|
||||
---@class druid.widget.property_input: druid.widget
|
||||
---@field root node
|
||||
---@field container druid.container
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field druid druid.instance
|
||||
---@field on_change_value event fun(text: string)
|
||||
local M = {}
|
||||
|
||||
function M:init()
|
||||
@@ -19,6 +22,12 @@ function M:init()
|
||||
self.container = self.druid:new_container(self.root)
|
||||
self.container:add_container("text_name")
|
||||
self.container:add_container("E_Anchor")
|
||||
|
||||
self.on_change_value = event.create()
|
||||
|
||||
self.rich_input.input.on_input_unselect:subscribe(function(_, text)
|
||||
self.on_change_value:trigger(text)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user