early debugging code
This commit is contained in:
parent
6df064282c
commit
8d24366492
2
help.go
2
help.go
|
@ -145,7 +145,7 @@ func setThingsOnTop() {
|
||||||
me.baseGui.SetViewOnBottom("msg")
|
me.baseGui.SetViewOnBottom("msg")
|
||||||
}
|
}
|
||||||
if me.stdout.startOnscreen {
|
if me.stdout.startOnscreen {
|
||||||
log.Info("attempting to locate stdout on screen for the first time")
|
log.Info("THIS TRIGGERS STDOUT")
|
||||||
me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH)
|
me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH)
|
||||||
me.stdout.startOnscreen = false
|
me.stdout.startOnscreen = false
|
||||||
}
|
}
|
||||||
|
|
13
init.go
13
init.go
|
@ -9,7 +9,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
@ -56,8 +55,8 @@ func init() {
|
||||||
me.clock.wId = -5
|
me.clock.wId = -5
|
||||||
|
|
||||||
Set(&me.dropdown, "default")
|
Set(&me.dropdown, "default")
|
||||||
s := fmt.Sprintln("fake default check =", me.FakeW, "dropdown.Id", me.dropdown.Id)
|
// s := fmt.Sprintln("fake default check =", me.FakeW, "dropdown.Id", me.dropdown.Id)
|
||||||
me.stdout.Write([]byte(s))
|
// me.stdout.Write([]byte(s))
|
||||||
|
|
||||||
me.mouse.mouseUp = true
|
me.mouse.mouseUp = true
|
||||||
me.mouse.clicktime = time.Millisecond * 200
|
me.mouse.clicktime = time.Millisecond * 200
|
||||||
|
@ -71,9 +70,9 @@ func init() {
|
||||||
if val, err := me.myTree.ConfigFind("stdout"); err == nil {
|
if val, err := me.myTree.ConfigFind("stdout"); err == nil {
|
||||||
if val == "true" {
|
if val == "true" {
|
||||||
me.stdout.startOnscreen = true
|
me.stdout.startOnscreen = true
|
||||||
me.stdout.Write([]byte("starting with stdout onscreen\n"))
|
// me.stdout.Write([]byte("starting with stdout onscreen\n"))
|
||||||
} else {
|
} else {
|
||||||
me.stdout.Write([]byte("starting with stdout offscreen\n"))
|
// me.stdout.Write([]byte("starting with stdout offscreen\n"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if val, err := me.myTree.ConfigFind("dark"); err == nil {
|
if val, err := me.myTree.ConfigFind("dark"); err == nil {
|
||||||
|
@ -218,7 +217,7 @@ func gocuiMain() {
|
||||||
// registered event handlers still have the events sent to gocuiEvent() above
|
// registered event handlers still have the events sent to gocuiEvent() above
|
||||||
registerHandlers(g)
|
registerHandlers(g)
|
||||||
|
|
||||||
me.stdout.Write([]byte("begin gogui.MainLoop()\n"))
|
// me.stdout.Write([]byte("begin gogui.MainLoop()\n"))
|
||||||
if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) {
|
if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) {
|
||||||
log.Log(NOW, "g.MainLoop() panic err =", err)
|
log.Log(NOW, "g.MainLoop() panic err =", err)
|
||||||
// normally panic here
|
// normally panic here
|
||||||
|
@ -292,7 +291,7 @@ func refreshGocui() {
|
||||||
// set the widget start width & height
|
// set the widget start width & height
|
||||||
|
|
||||||
func newWindowTrigger() {
|
func newWindowTrigger() {
|
||||||
log.Log(NOW, "newWindowTriggerl() START")
|
// log.Log(NOW, "newWindowTriggerl() START")
|
||||||
for {
|
for {
|
||||||
// log.Log(NOW, "GO plugin toolkit made a new window")
|
// log.Log(NOW, "GO plugin toolkit made a new window")
|
||||||
select {
|
select {
|
||||||
|
|
|
@ -18,9 +18,16 @@ import (
|
||||||
func createStdout(g *gocui.Gui) bool {
|
func createStdout(g *gocui.Gui) bool {
|
||||||
if me.stdout.tk == nil {
|
if me.stdout.tk == nil {
|
||||||
makeOutputWidget(g, "this is a create before a mouse click")
|
makeOutputWidget(g, "this is a create before a mouse click")
|
||||||
msg := fmt.Sprintf("test out gocuiEvent() %d\n", me.ecount)
|
|
||||||
// me.logStdout.v.Write([]byte(msg))
|
// me.logStdout.v.Write([]byte(msg))
|
||||||
|
|
||||||
|
// this will show very early debugging output
|
||||||
|
// keep this code commented out but do not remove it. when it doubt, this will be the Light of Elendil
|
||||||
|
// NEVER REMOVE THIS CODE
|
||||||
|
|
||||||
|
msg := fmt.Sprintf("test out gocuiEvent() %d\n", me.ecount)
|
||||||
me.stdout.tk.Write([]byte(msg))
|
me.stdout.tk.Write([]byte(msg))
|
||||||
|
|
||||||
|
|
||||||
log.Log(NOW, "logStdout test out")
|
log.Log(NOW, "logStdout test out")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -234,12 +234,11 @@ func Set(ptr interface{}, tag string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func setField(field reflect.Value, defaultVal string, name string) error {
|
func setField(field reflect.Value, defaultVal string, name string) error {
|
||||||
|
|
||||||
if !field.CanSet() {
|
if !field.CanSet() {
|
||||||
// log("setField() Can't set value", field, defaultVal)
|
// log("setField() Can't set value", field, defaultVal)
|
||||||
return fmt.Errorf("Can't set value\n")
|
return fmt.Errorf("Can't set value\n")
|
||||||
} else {
|
} else {
|
||||||
log.Log(NOW, "setField() Can set value", name, defaultVal)
|
// log.Log(NOW, "setField() Can set value", name, defaultVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch field.Kind() {
|
switch field.Kind() {
|
||||||
|
|
Loading…
Reference in New Issue