summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'init.go')
-rw-r--r--init.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/init.go b/init.go
index 425be56..f23c391 100644
--- a/init.go
+++ b/init.go
@@ -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)
}