summaryrefslogtreecommitdiff
path: root/plugin.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-06 01:42:40 -0600
committerJeff Carr <[email protected]>2025-02-06 01:42:40 -0600
commit31c130045d903b3c874dbf8728589a6a909704ae (patch)
tree0abb0bdedd03b7556c08ca86ef1137dc759e4d8a /plugin.go
parent70a742c98acfe8979bb3c040abd6030388e61542 (diff)
add a goroutine and channel to trigger window redraw
Diffstat (limited to 'plugin.go')
-rw-r--r--plugin.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin.go b/plugin.go
index 702ac4c..8509bba 100644
--- a/plugin.go
+++ b/plugin.go
@@ -182,3 +182,22 @@ func (tk *guiWidget) SetText(text string) {
tk.Show()
}
}
+
+func (tk *guiWidget) GetText() string {
+ if tk == nil {
+ log.Log(NOW, "widget is nil")
+ return ""
+ }
+ // deprecate this
+ if tk.labelN != "" {
+ return tk.labelN
+ }
+ if tk.node == nil {
+ // return gocui.view name?
+ return tk.cuiName
+ }
+ if tk.node.State.Label != "" {
+ return tk.node.State.Label
+ }
+ return ""
+}