diff options
| author | Jeff Carr <[email protected]> | 2025-02-06 01:42:40 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-06 01:42:40 -0600 |
| commit | 31c130045d903b3c874dbf8728589a6a909704ae (patch) | |
| tree | 0abb0bdedd03b7556c08ca86ef1137dc759e4d8a /init.go | |
| parent | 70a742c98acfe8979bb3c040abd6030388e61542 (diff) | |
add a goroutine and channel to trigger window redraw
Diffstat (limited to 'init.go')
| -rw-r--r-- | init.go | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -11,6 +11,7 @@ import ( "errors" "os" "runtime/debug" + "time" "github.com/awesome-gocui/gocui" "go.wit.com/log" @@ -51,6 +52,9 @@ func init() { me.myTree.SetChecked = queueSetChecked me.myTree.ToolkitClose = queueToolkitClose + me.newWindowTrigger = make(chan bool, 1) + go newWindowTrigger() + log.Log(NOW, "Init() start pluginChan") log.Sleep(.1) // probably not needed, but in here for now under development go mainGogui() @@ -184,3 +188,17 @@ func gocuiMain() { panic("gocuiTKmainloop OOPS") } } + +func newWindowTrigger() { + log.Log(NOW, "newWindowTriggerl() START") + for { + log.Log(NOW, "newWindowTrigger() for loop") + select { + case a := <-me.newWindowTrigger: + log.Log(NOW, "newWindowTrigger() got new window", a) + time.Sleep(200 * time.Millisecond) + redoWindows(1, -1) + log.Log(NOW, "newWindowTrigger() after sleep") + } + } +} |
