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")
|
||||
}
|
||||
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.startOnscreen = false
|
||||
}
|
||||
|
|
13
init.go
13
init.go
|
@ -9,7 +9,6 @@ package main
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
|
@ -56,8 +55,8 @@ func init() {
|
|||
me.clock.wId = -5
|
||||
|
||||
Set(&me.dropdown, "default")
|
||||
s := fmt.Sprintln("fake default check =", me.FakeW, "dropdown.Id", me.dropdown.Id)
|
||||
me.stdout.Write([]byte(s))
|
||||
// s := fmt.Sprintln("fake default check =", me.FakeW, "dropdown.Id", me.dropdown.Id)
|
||||
// me.stdout.Write([]byte(s))
|
||||
|
||||
me.mouse.mouseUp = true
|
||||
me.mouse.clicktime = time.Millisecond * 200
|
||||
|
@ -71,9 +70,9 @@ func init() {
|
|||
if val, err := me.myTree.ConfigFind("stdout"); err == nil {
|
||||
if val == "true" {
|
||||
me.stdout.startOnscreen = true
|
||||
me.stdout.Write([]byte("starting with stdout onscreen\n"))
|
||||
// me.stdout.Write([]byte("starting with stdout onscreen\n"))
|
||||
} 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 {
|
||||
|
@ -218,7 +217,7 @@ func gocuiMain() {
|
|||
// registered event handlers still have the events sent to gocuiEvent() above
|
||||
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) {
|
||||
log.Log(NOW, "g.MainLoop() panic err =", err)
|
||||
// normally panic here
|
||||
|
@ -292,7 +291,7 @@ func refreshGocui() {
|
|||
// set the widget start width & height
|
||||
|
||||
func newWindowTrigger() {
|
||||
log.Log(NOW, "newWindowTriggerl() START")
|
||||
// log.Log(NOW, "newWindowTriggerl() START")
|
||||
for {
|
||||
// log.Log(NOW, "GO plugin toolkit made a new window")
|
||||
select {
|
||||
|
|
|
@ -18,9 +18,16 @@ import (
|
|||
func createStdout(g *gocui.Gui) bool {
|
||||
if me.stdout.tk == nil {
|
||||
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))
|
||||
|
||||
// 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))
|
||||
|
||||
|
||||
log.Log(NOW, "logStdout test out")
|
||||
}
|
||||
return true
|
||||
|
|
|
@ -234,12 +234,11 @@ func Set(ptr interface{}, tag string) error {
|
|||
}
|
||||
|
||||
func setField(field reflect.Value, defaultVal string, name string) error {
|
||||
|
||||
if !field.CanSet() {
|
||||
// log("setField() Can't set value", field, defaultVal)
|
||||
return fmt.Errorf("Can't set value\n")
|
||||
} else {
|
||||
log.Log(NOW, "setField() Can set value", name, defaultVal)
|
||||
// log.Log(NOW, "setField() Can set value", name, defaultVal)
|
||||
}
|
||||
|
||||
switch field.Kind() {
|
||||
|
|
Loading…
Reference in New Issue