diff options
| author | ruki <[email protected]> | 2018-01-20 00:45:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-19 22:32:58 +0800 |
| commit | ba7696ff7174d8d07e6aec4138b9cce5f0952ca4 (patch) | |
| tree | ef52c41eca271695dad3c802efc8be8c0bdf8b8a /xmake/core/ui/label.lua | |
| parent | 35ca390ac845a86c78e34059946207f8f980ed5e (diff) | |
add text changed
Diffstat (limited to 'xmake/core/ui/label.lua')
| -rw-r--r-- | xmake/core/ui/label.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/core/ui/label.lua b/xmake/core/ui/label.lua index 2615414c1..d2f571c6c 100644 --- a/xmake/core/ui/label.lua +++ b/xmake/core/ui/label.lua @@ -25,6 +25,7 @@ -- load modules local log = require("ui/log") local view = require("ui/view") +local event = require("ui/event") local curses = require("ui/curses") -- define module @@ -66,7 +67,14 @@ end -- set text function label:text_set(text) - self._TEXT = text or "" + text = text or "" + if self._TEXT ~= text then + local action = self:action("text.changed") + if action then + action(self, event.text {text}) + end + end + self._TEXT = text self:invalidate() return self end |
