diff options
| author | Jeff Carr <[email protected]> | 2025-03-03 08:31:21 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-03 08:31:21 -0600 |
| commit | 75014f4b284d3e88266c1ae319ee9bbdb86d3ad2 (patch) | |
| tree | e7285307e91f4291d4361568ed1f89bd6ad9e1d6 /init.go | |
| parent | 9ef16c1bf2bfc1e00163b461779383c809efff9f (diff) | |
define a background widget more properly
Diffstat (limited to 'init.go')
| -rw-r--r-- | init.go | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -26,6 +26,9 @@ var BUILDTIME string var PLUGIN string = "gocui" +// this is called at the very initial connection +// between the app and this gocui plugin +// this is a good place to initialize gocui's default behavior func toolkitInit() { log.Info("gocui toolkitInit() me.ok =", me.ok) if me.baseGui == nil { @@ -62,14 +65,19 @@ func toolkitInit() { setThingsOnTop() // SETUP STDOUT END + // SETUP BG + if me.BG.tk == nil { + me.BG.tk = makeNewInternalWidget(me.BG.wId) + } + // PUT INIT DEBUG COOE HERE var toggle bool - for i := 0; i < 3; i++ { + for i := 0; i < 6; i++ { w := me.treeRoot.TK.(*guiWidget) w.dumpTree("MM") w.dumpWindows("WW") - time.Sleep(500 * time.Millisecond) + time.Sleep(1000 * time.Millisecond) if toggle { toggle = false log.Info("gocui toolkitInit() put testing true stuff here") @@ -77,6 +85,7 @@ func toolkitInit() { toggle = true log.Info("gocui toolkitInit() put testing false stuff here") } + setBottomBG() } // PUT INIT DEBUG COOE HERE END @@ -145,15 +154,15 @@ func initPlugin() { log.Info("error opening file:", err) os.Exit(0) } + // todo: some early output still goes to the /tmp/ file + //time.Sleep(200 * time.Millisecond) + log.CaptureMode(me.stdout) } me.starttime = time.Now() log.Log(INFO, "Init() of awesome-gocui") // init the config struct default values Set(&me, "default") - // todo: some early output still goes to the /tmp/ file - //time.Sleep(200 * time.Millisecond) - log.CaptureMode(me.stdout) // initial app window settings @@ -167,6 +176,7 @@ func initPlugin() { me.dropdown.wId = -77 me.textbox.wId = -55 me.stdout.wId = -4 + me.BG.wId = -22 // the clock widget id and offset me.notify.clock.wId = -5 @@ -189,8 +199,9 @@ func initPlugin() { log.Log(NOW, "Init() start pluginChan") if me.stdout.disable { - log.Info("USING STDOUT") + log.Info("Using STDOUT") } else { + log.Info("Using gocui STDOUT") os.Stdout = me.outf log.CaptureMode(me.outf) } |
