Compare commits

...

14 Commits

24 changed files with 323 additions and 198 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
go.mod go.mod
go.sum go.sum
gocui gocui
resources/*.so

View File

@ -25,7 +25,7 @@ custom:
clean: clean:
rm -f gocui *.so go.* rm -f gocui *.so go.*
rm -f *.pb.go *.patch rm -f *.pb.go *.patch
go-mod-clean --purge go-mod-clean purge
# Test the README.md & doc.go file # Test the README.md & doc.go file
# this runs pkgsite, the binary that does dev.go.dev # this runs pkgsite, the binary that does dev.go.dev

View File

@ -186,6 +186,27 @@ func (tk *guiWidget) setColorLabel() {
tk.updateColor() tk.updateColor()
} }
func (tk *guiWidget) setColorLabelTable() {
if tk.color == nil {
tk.color = new(colorT)
}
if me.dark {
tk.color.frame = gocui.AttrNone
tk.color.fg = gocui.ColorWhite
tk.color.bg = gocui.ColorBlack
tk.color.selFg = gocui.ColorWhite
tk.color.selBg = gocui.AttrNone
} else {
tk.color.frame = gocui.AttrNone
tk.color.fg = gocui.ColorBlack
tk.color.bg = gocui.AttrNone
tk.color.selFg = gocui.AttrNone
tk.color.selBg = gocui.ColorGreen
}
tk.updateColor()
}
func (tk *guiWidget) setColorButtonDense() { func (tk *guiWidget) setColorButtonDense() {
if tk.color == nil { if tk.color == nil {
tk.color = new(colorT) tk.color = new(colorT)

View File

@ -86,6 +86,10 @@ func (tk *guiWidget) dumpWidget(s string) {
} else { } else {
end = fmt.Sprintf("%-8s %-8s %s", tk.WidgetType(), tk.cuiName, tk.String()) end = fmt.Sprintf("%-8s %-8s %s", tk.WidgetType(), tk.cuiName, tk.String())
} }
if tk.node.InTable() {
// log.Log(GOCUI, "findParentTAble()", tk.labelN, tk.cuiName, tk.node.WidgetId)
end += " (table)"
}
log.Log(GOCUI, s1, s, end) log.Log(GOCUI, s1, s, end)
} }

View File

@ -58,6 +58,7 @@ func registerHandlers(g *gocui.Gui) {
g.SetKeybinding("", 'L', gocui.ModNone, printWidgetTree) // 'L' list all widgets in tree view g.SetKeybinding("", 'L', gocui.ModNone, printWidgetTree) // 'L' list all widgets in tree view
g.SetKeybinding("", 'f', gocui.ModNone, theFind) // 'f' shows what is under your mouse g.SetKeybinding("", 'f', gocui.ModNone, theFind) // 'f' shows what is under your mouse
g.SetKeybinding("", 'd', gocui.ModNone, theLetterD) // 'd' toggles on and off debugging buttons g.SetKeybinding("", 'd', gocui.ModNone, theLetterD) // 'd' toggles on and off debugging buttons
g.SetKeybinding("", 'r', gocui.ModNone, reverseStdout) // 'r' turns scrolling of STDOUT upside down
g.SetKeybinding("", 'q', gocui.ModNone, quit) // 'q' only exits gocui. plugin stays alive (?) g.SetKeybinding("", 'q', gocui.ModNone, quit) // 'q' only exits gocui. plugin stays alive (?)
} }
@ -103,28 +104,20 @@ func theDarkness(g *gocui.Gui, v *gocui.View) error {
log.Info("you have seen the light") log.Info("you have seen the light")
} else { } else {
me.dark = true me.dark = true
log.Info("you have entered into darkness") log.Info("you have entered into darkness (you may need to trigger SIGWINCH)")
log.Info("or maybe open a new window. notsure. This obviously isn't finished.")
log.Info("submit patches to this and you will definitely get free cloud credits at WIT")
} }
return nil return nil
} }
func wheelsUp(g *gocui.Gui, v *gocui.View) error { func wheelsUp(g *gocui.Gui, v *gocui.View) error {
// log.Info("private wheels up") stdoutWheelsUp()
me.stdout.pager -= 2
if me.stdout.pager < 0 {
me.stdout.pager = 0
}
me.stdout.tk.refreshStdout()
return nil return nil
} }
func wheelsDown(g *gocui.Gui, v *gocui.View) error { func wheelsDown(g *gocui.Gui, v *gocui.View) error {
// log.Info("you've landed") stdoutWheelsDown()
me.stdout.pager += 2
if me.stdout.pager > len(me.stdout.outputS) {
me.stdout.pager = len(me.stdout.outputS)
}
me.stdout.tk.refreshStdout()
return nil return nil
} }
@ -148,11 +141,13 @@ func doEsc(g *gocui.Gui, v *gocui.View) error {
me.dropdown.tk.Hide() me.dropdown.tk.Hide()
me.dropdown.active = false me.dropdown.active = false
log.Info("escaped from dropdown") log.Info("escaped from dropdown")
me.baseGui.SetCurrentView(me.notify.clock.tk.cuiName)
} }
if me.textbox.active { if me.textbox.active {
me.textbox.tk.Hide() me.textbox.tk.Hide()
me.textbox.active = false me.textbox.active = false
log.Info("escaped from textbox") log.Info("escaped from textbox")
me.baseGui.SetCurrentView(me.notify.clock.tk.cuiName)
} }
return nil return nil
} }
@ -190,6 +185,19 @@ func theFind(g *gocui.Gui, v *gocui.View) error {
return nil return nil
} }
func reverseStdout(g *gocui.Gui, v *gocui.View) error {
if me.stdout.reverse {
me.stdout.reverse = false
log.Info("stdout scrolling normal")
} else {
me.stdout.reverse = true
log.Info("stdout scrolling is reversed. this is sometimes useful when you")
log.Info("only need to see a few most recent lines and have the STDOUT window")
log.Info("take up minimal realestate at the bottom of your window")
}
return nil
}
// is run whenever anyone hits 'd' (in an open space) // is run whenever anyone hits 'd' (in an open space)
func theLetterD(g *gocui.Gui, v *gocui.View) error { func theLetterD(g *gocui.Gui, v *gocui.View) error {
// widgets that don't have physical existance in // widgets that don't have physical existance in

View File

@ -8,12 +8,14 @@ import (
"github.com/awesome-gocui/gocui" "github.com/awesome-gocui/gocui"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/toolkits/tree"
) )
func theStdout(g *gocui.Gui, v *gocui.View) error { func theStdout(g *gocui.Gui, v *gocui.View) error {
// me.stdout.pager = 0 // me.stdout.pager = 0
infos := fmt.Sprintf("pager=%d len(%d) ", me.stdout.pager, len(me.stdout.outputS)) infos := fmt.Sprintf("pager=%d len(%d) ", me.stdout.pager, len(me.stdout.outputS))
infos += fmt.Sprintf("last(%d,%d)", me.stdout.lastW, me.stdout.lastH) infos += fmt.Sprintf("last(%d,%d)", me.stdout.lastW, me.stdout.lastH)
me.stdout.changed = true
if me.stdout.outputOnTop { if me.stdout.outputOnTop {
if me.stdout.outputOffscreen { if me.stdout.outputOffscreen {
@ -22,18 +24,38 @@ func theStdout(g *gocui.Gui, v *gocui.View) error {
me.stdout.lastW = me.stdout.tk.gocuiSize.w0 me.stdout.lastW = me.stdout.tk.gocuiSize.w0
me.stdout.lastH = me.stdout.tk.gocuiSize.h0 me.stdout.lastH = me.stdout.tk.gocuiSize.h0
relocateStdoutOffscreen() relocateStdoutOffscreen()
new1 := new(tree.ToolkitConfig)
new1.Plugin = "gocui"
new1.Name = "stdoutoffscreen"
new1.Value = "true"
me.myTree.ConfigSave(new1)
return nil return nil
} else { } else {
me.stdout.outputOffscreen = true me.stdout.outputOffscreen = true
log.Info("stdout moved on screen", infos) log.Info("stdout moved on screen", infos)
new1 := new(tree.ToolkitConfig)
new1.Plugin = "gocui"
new1.Name = "stdoutoffscreen"
new1.Value = "false"
me.myTree.ConfigSave(new1)
} }
// move the stdout window back onscreen // move the stdout window back onscreen
me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH) me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH)
me.stdout.outputOnTop = false me.stdout.outputOnTop = false
setThingsOnTop() setThingsOnTop()
new1 := new(tree.ToolkitConfig)
new1.Plugin = "gocui"
new1.Name = "stdoutlevel"
new1.Value = "bottom"
me.myTree.ConfigSave(new1)
} else { } else {
me.stdout.outputOnTop = true me.stdout.outputOnTop = true
setThingsOnTop() setThingsOnTop()
new1 := new(tree.ToolkitConfig)
new1.Plugin = "gocui"
new1.Name = "stdoutlevel"
new1.Value = "top"
me.myTree.ConfigSave(new1)
} }
return nil return nil
} }
@ -55,14 +77,20 @@ func stdoutHome(g *gocui.Gui, v *gocui.View) error {
} }
func stdoutArrowUp(g *gocui.Gui, v *gocui.View) error { func stdoutArrowUp(g *gocui.Gui, v *gocui.View) error {
me.stdout.pager += 1 if me.stdout.reverse {
me.stdout.tk.refreshStdout() stdoutWheelsDown()
} else {
stdoutWheelsUp()
}
return nil return nil
} }
func stdoutArrowDown(g *gocui.Gui, v *gocui.View) error { func stdoutArrowDown(g *gocui.Gui, v *gocui.View) error {
me.stdout.pager -= 1 if me.stdout.reverse {
me.stdout.tk.refreshStdout() stdoutWheelsUp()
} else {
stdoutWheelsDown()
}
return nil return nil
} }
@ -81,3 +109,23 @@ func stdoutPgdn(g *gocui.Gui, v *gocui.View) error {
tk.refreshStdout() tk.refreshStdout()
return nil return nil
} }
// scrolling up with the mouse wheel (or trackpad)
func stdoutWheelsUp() {
// log.Info("private wheels up")
me.stdout.pager -= 2
if me.stdout.pager < 0 {
me.stdout.pager = 0
}
me.stdout.tk.refreshStdout()
}
// scrolling down with the mouse wheel (or trackpad)
func stdoutWheelsDown() {
// log.Info("you've landed")
me.stdout.pager += 2
if me.stdout.pager > len(me.stdout.outputS) {
me.stdout.pager = len(me.stdout.outputS)
}
me.stdout.tk.refreshStdout()
}

View File

@ -5,6 +5,7 @@ package main
import ( import (
"errors" "errors"
"fmt"
"github.com/awesome-gocui/gocui" "github.com/awesome-gocui/gocui"
"go.wit.com/log" "go.wit.com/log"
@ -39,6 +40,36 @@ func quit(g *gocui.Gui, v *gocui.View) error {
return gocui.ErrQuit return gocui.ErrQuit
} }
func (tk *guiWidget) SetView() error {
if me.baseGui == nil {
return fmt.Errorf("me.baseGui == nil")
}
r := new(rectType)
r.w0 = tk.gocuiSize.w0
r.h0 = tk.gocuiSize.h0
r.w1 = tk.gocuiSize.w1
r.h1 = tk.gocuiSize.h1
return tk.SetViewRect(r)
}
func (tk *guiWidget) SetViewRect(r *rectType) error {
if me.baseGui == nil {
return fmt.Errorf("me.baseGui == nil")
}
var err error
tk.v, err = me.baseGui.SetView(tk.cuiName, r.w0, r.h0, r.w1, r.h1, 0)
if err != nil {
if !errors.Is(err, gocui.ErrUnknownView) {
log.Log(ERROR, "SetView() global failed on name =", tk.cuiName)
return err
}
}
return nil
}
func SetView(name string, x0, y0, x1, y1 int, overlaps byte) *gocui.View { func SetView(name string, x0, y0, x1, y1 int, overlaps byte) *gocui.View {
if me.baseGui == nil { if me.baseGui == nil {
log.Log(ERROR, "SetView() ERROR: me.baseGui == nil") log.Log(ERROR, "SetView() ERROR: me.baseGui == nil")

View File

@ -27,7 +27,7 @@ func doMouseClick(w int, h int) {
// can't drag or do anything when dropdown or textbox are visible // can't drag or do anything when dropdown or textbox are visible
for _, tk := range findByXY(w, h) { for _, tk := range findByXY(w, h) {
if tk.WidgetId() == me.dropdown.wId { if tk.WidgetId() == me.dropdown.wId {
log.Info("got dropdwon click", w, h, tk.cuiName) log.Info("got dropdown click", w, h, tk.cuiName)
tk.dropdownClicked(w, h) tk.dropdownClicked(w, h)
return return
} }
@ -107,8 +107,17 @@ func doMouseClick(w int, h int) {
tk.showDropdown() tk.showDropdown()
return return
case widget.Textbox: case widget.Textbox:
log.Log(WARN, "TODO: textbox click")
tk.prepTextbox() tk.prepTextbox()
return return
case widget.Label:
if tk.node.InTable() {
if tk.node.State.AtH == 0 {
log.Log(NOW, "todo: sort by column here")
tk.dumpWidget("sort")
}
}
return
default: default:
// TODO: enable the GUI debugger in gocui // TODO: enable the GUI debugger in gocui
// tk.dumpWidget("undef click()") // enable this to debug widget clicks // tk.dumpWidget("undef click()") // enable this to debug widget clicks

View File

@ -48,6 +48,7 @@ func mouseMove(g *gocui.Gui) {
// old hack. create the 'msg' view if it does not yet exist // old hack. create the 'msg' view if it does not yet exist
// TODO: put this somewhere more correct // TODO: put this somewhere more correct
if widgetView, _ := g.View("msg"); widgetView == nil { if widgetView, _ := g.View("msg"); widgetView == nil {
me.stdout.changed = true
if createStdout(g) { if createStdout(g) {
return return
} }
@ -110,15 +111,7 @@ func (tk *guiWidget) moveNew() {
tk.makeWindowActive() tk.makeWindowActive()
return return
} }
/*
if tk.WidgetType() == widget.Flag {
me.baseGui.SetView(tk.cuiName, w-3, h-3, w+20, h+20, 0)
// tk.verifyRect()
s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName)
tk.dumpWidget(s)
return
}
*/
if tk.WidgetType() == widget.Stdout { if tk.WidgetType() == widget.Stdout {
if me.mouse.resize { if me.mouse.resize {
newW := w - me.stdout.lastW newW := w - me.stdout.lastW
@ -138,5 +131,6 @@ func (tk *guiWidget) moveNew() {
// log.Info("Resize false", w, h, newW, newH) // log.Info("Resize false", w, h, newW, newH)
} }
setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
me.stdout.changed = true
} }
} }

13
find.go
View File

@ -129,13 +129,6 @@ func findWindowUnderMouse() *guiWidget {
} }
} }
/*
// print out the window list
for _, tk := range me.allwin {
log.Info("findWindowUnderMouse() print:", tk.labelN, tk.window.active, tk.window.order)
}
*/
// now check if the active window is below the mouse // now check if the active window is below the mouse
for _, tk := range me.allwin { for _, tk := range me.allwin {
if tk.window.active { if tk.window.active {
@ -152,12 +145,6 @@ func findWindowUnderMouse() *guiWidget {
return a.window.order - b.window.order return a.window.order - b.window.order
}) })
/*
// print out the window list
for _, tk := range me.allwin {
log.Info("findWindowUnderMouse() print:", tk.labelN, tk.window.active, tk.window.order)
}
*/
for _, win := range me.allwin { for _, win := range me.allwin {
if win.full.inRect(w, h) { if win.full.inRect(w, h) {
// log.Info(fmt.Sprintf("findWindowUnderMouse() found %s window (%dx%d)", win.cuiName, w, h)) // log.Info(fmt.Sprintf("findWindowUnderMouse() found %s window (%dx%d)", win.cuiName, w, h))

20
help.go
View File

@ -25,16 +25,20 @@ import (
var helpText []string = []string{"Help Menu", var helpText []string = []string{"Help Menu",
"", "",
"Tab: toggle through windows", "Tab toggle through windows",
"O: toggle STDOUT", "'O' toggle STDOUT",
"H: toggle this gocui menu", "'H' toggle this gocui menu",
"L: toggle light/dark mode", "'D' toggle light/dark mode",
"CTRL-c: quit()", "CTRL-z background to shell",
"CTRL-c quit()",
"", "",
"Debugging:", "Debugging:",
"S: Supermouse mode", "'S' Supermouse mode",
"M: list all widget positions", "'M' list all widget positions",
"L: list all widgets in tree", "'L' list all widgets in tree",
"<Pgup> scroll up the STDOUT window",
"<Pgdn> scroll down the STDOUT window",
"'r' reverse STDOUT scrolling",
} }
func hideHelp() { func hideHelp() {

51
init.go
View File

@ -14,10 +14,13 @@ import (
"runtime" "runtime"
"runtime/debug" "runtime/debug"
"runtime/pprof" "runtime/pprof"
"strconv"
"strings"
"time" "time"
"github.com/awesome-gocui/gocui" "github.com/awesome-gocui/gocui"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/toolkits/tree"
) )
// sent via -ldflags // sent via -ldflags
@ -105,7 +108,6 @@ func toolkitInit() {
if me.textbox.tk == nil { if me.textbox.tk == nil {
log.Log(INFO, "gocui toolkitInit() initTextbox me.ok =", me.ok) log.Log(INFO, "gocui toolkitInit() initTextbox me.ok =", me.ok)
initTextbox() initTextbox()
me.textbox.tk.prepTextbox()
} }
// TEST TEXTBOX END // TEST TEXTBOX END
} }
@ -145,6 +147,12 @@ func initPlugin() {
me.stdout.disable = true me.stdout.disable = true
} }
} }
if val, err := me.myTree.ConfigFind("stdoutoffscreen"); err == nil {
if val == "false" {
// log.Log(NOW, "gocui: START ON SCREEN TRUE")
me.stdout.startOnscreen = true
}
}
if val, err := me.myTree.ConfigFind("dark"); err == nil { if val, err := me.myTree.ConfigFind("dark"); err == nil {
if val == "true" { if val == "true" {
me.dark = true me.dark = true
@ -157,12 +165,15 @@ func initPlugin() {
} }
// todo: make this a tmp file that goes away // todo: make this a tmp file that goes away
if !me.stdout.disable { if !me.stdout.disable {
log.Log(INFO, "stdout.disable == true. writing to /tmp/captureMode.log") tmpFile, err := os.CreateTemp("", "gocui-*.log")
me.outf, err = os.OpenFile("/tmp/captureMode.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil { if err != nil {
log.Info("error opening file:", err) fmt.Println("Error creating temp file:", err)
os.Exit(0) standardExit()
} }
// defer os.Remove(tmpFile.Name())
log.Log(INFO, "stdout.disable == true. writing to", tmpFile.Name())
me.outf = tmpFile
// todo: some early output still goes to the /tmp/ file // todo: some early output still goes to the /tmp/ file
//time.Sleep(200 * time.Millisecond) //time.Sleep(200 * time.Millisecond)
log.CaptureMode(me.stdout) log.CaptureMode(me.stdout)
@ -181,6 +192,20 @@ func initPlugin() {
me.stdout.lastW = 4 me.stdout.lastW = 4
me.stdout.lastH = 20 me.stdout.lastH = 20
if val, err := me.myTree.ConfigFind("stdoutsize"); err == nil {
parts := strings.Fields(val)
if len(parts) == 4 {
log.Info("initial stdout settings:", parts, "setting startOnscreen = true")
me.stdout.w, _ = strconv.Atoi(parts[0])
me.stdout.h, _ = strconv.Atoi(parts[1])
me.stdout.lastW, _ = strconv.Atoi(parts[2])
me.stdout.lastH, _ = strconv.Atoi(parts[3])
me.stdout.startOnscreen = true
} else {
log.Info("initial stdout settings parse error:", parts)
}
}
// just make up unique values for these // just make up unique values for these
me.dropdown.wId = -77 me.dropdown.wId = -77
me.textbox.wId = -55 me.textbox.wId = -55
@ -289,6 +314,7 @@ func standardExit() {
if me.outf != nil { if me.outf != nil {
log.Log(NOW, "standardExit() doing outf.Close()") log.Log(NOW, "standardExit() doing outf.Close()")
me.outf.Close() me.outf.Close()
os.Remove(me.outf.Name())
} }
// log(true, "standardExit() setOutput(os.Stdout)") // log(true, "standardExit() setOutput(os.Stdout)")
// setOutput(os.Stdout) // setOutput(os.Stdout)
@ -305,6 +331,7 @@ func standardClose() {
me.baseGui.Close() me.baseGui.Close()
log.Log(NOW, "standardExit() doing outf.Close()") log.Log(NOW, "standardExit() doing outf.Close()")
me.outf.Close() me.outf.Close()
os.Remove(me.outf.Name())
// os.Stdin = os.Stdin // os.Stdin = os.Stdin
// os.Stdout = os.Stdout // os.Stdout = os.Stdout
// os.Stderr = os.Stderr // os.Stderr = os.Stderr
@ -371,6 +398,19 @@ func refreshGocui() {
me.newWindowTrigger <- me.treeRoot.TK.(*guiWidget) me.newWindowTrigger <- me.treeRoot.TK.(*guiWidget)
me.refresh = false me.refresh = false
} }
if me.stdout.changed {
me.stdout.changed = false
lastRefresh = time.Now()
new1 := new(tree.ToolkitConfig)
new1.Plugin = "gocui"
new1.Name = "stdoutsize"
width := me.stdout.tk.gocuiSize.w1 - me.stdout.tk.gocuiSize.w0
height := me.stdout.tk.gocuiSize.h1 - me.stdout.tk.gocuiSize.h0
new1.Value = fmt.Sprintf("%d %d %d %d", width, height, me.stdout.tk.gocuiSize.w0, me.stdout.tk.gocuiSize.h0)
me.myTree.ConfigSave(new1)
// log.Log(NOW, "newWindowTrigger() gocui setting stdout size =", new1.Value)
// me.stdout.tk.dumpWidget("save")
}
} }
// this code updates the clock // this code updates the clock
@ -416,7 +456,6 @@ func newWindowTrigger() {
} }
if me.textbox.tk == nil { if me.textbox.tk == nil {
initTextbox() initTextbox()
me.textbox.tk.prepTextbox()
} }
tk.makeWindowActive() tk.makeWindowActive()
me.myTree.Unlock() me.myTree.Unlock()

View File

@ -150,6 +150,17 @@ func setNotifyIconText(s string) {
me.notify.icon.tk.setColorNotifyIcon() me.notify.icon.tk.setColorNotifyIcon()
me.baseGui.SetViewOnTop(me.notify.icon.tk.v.Name()) me.baseGui.SetViewOnTop(me.notify.icon.tk.v.Name())
log.Info("setNotifyIconText() updated menu to:", me.notify.icon.tk.labelN) log.Info("setNotifyIconText() updated menu to:", me.notify.icon.tk.labelN)
// print out the window list // TODO: put this in libnotify
for _, tk := range me.allwin {
log.Info("known window Window", tk.labelN, tk.window.active, tk.window.order)
}
if s == "[X]" {
log.Warn("should turn on help window here")
showHelp()
} else {
log.Warn("should turn off help window here")
hideHelp()
}
} }
// in the very end of redrawing things, this will place the help and stdout on the top or botton // in the very end of redrawing things, this will place the help and stdout on the top or botton
@ -207,15 +218,14 @@ func hardDrawUnderMouse(tk *guiWidget, name string) {
tk.Hide() tk.Hide()
} }
w, h := me.baseGui.MousePosition() w, h := me.baseGui.MousePosition()
a := w r := new(rectType)
b := h r.w0 = w
c := w + 8 r.h0 = h
d := h + 4 r.w1 = w + 8
var err error r.h1 = h + 4
tk.v, err = me.baseGui.SetView(tk.cuiName, a, b, c, d, 0) if err := tk.SetViewRect(r); err != nil {
if err == nil { log.Info("hardDrawUnderMouse() err", tk.cuiName, err)
log.Info("hardDrawUnderMouse() err ok widget", tk.cuiName) tk.dumpWidget("hardDrawERR")
tk.dumpWidget("hard draw err")
} }
tk.v.Frame = false tk.v.Frame = false
tk.v.Clear() tk.v.Clear()
@ -226,20 +236,14 @@ func hardDrawAtgocuiSize(tk *guiWidget) {
if tk.v != nil { if tk.v != nil {
tk.Hide() tk.Hide()
} }
a := tk.gocuiSize.w0 if err := tk.SetView(); err != nil {
b := tk.gocuiSize.h0
c := tk.gocuiSize.w1
d := tk.gocuiSize.h1
var err error
tk.v, err = me.baseGui.SetView(tk.cuiName, a, b, c, d, 0)
if err == nil {
log.Info("hardDrawAtgocuiSize() err ok widget", tk.cuiName) log.Info("hardDrawAtgocuiSize() err ok widget", tk.cuiName)
tk.dumpWidget("hard draw err") tk.dumpWidget("hardDrawERR")
} }
tk.v.Frame = false tk.v.Frame = false
tk.v.Clear() tk.v.Clear()
tk.v.WriteString(tk.labelN) tk.v.WriteString(tk.labelN)
log.Verbose("hardDrawAtgocuiSize() err ok widget", tk.cuiName, a, b, c, d, tk.v.Name()) // log.Verbose("hardDrawAtgocuiSize() err ok widget", tk.cuiName, a, b, c, d, tk.v.Name())
} }
func sigWinchIcon() { func sigWinchIcon() {
@ -252,20 +256,15 @@ func sigWinchIcon() {
func sigWinchBG() { func sigWinchBG() {
tk := me.BG.tk tk := me.BG.tk
w, h := me.baseGui.Size() w, h := me.baseGui.Size()
a := -1 tk.gocuiSize.w0 = -1
b := -1 tk.gocuiSize.h0 = -1
c := w + 1 tk.gocuiSize.w1 = w + 1
d := h + 1 tk.gocuiSize.h1 = h + 1
var err error if err := tk.SetView(); err != nil {
tk.v, err = me.baseGui.SetView(tk.cuiName, a, b, c, d, 0) tk.dumpWidget("sigWinchBGerr()")
if err == nil { log.Log(ERROR, "sigWinchBG()", err)
if tk.v == nil {
tk.dumpWidget("drawView() err")
log.Log(ERROR, "drawView() internal plugin error err = nil")
} }
return log.Log(INFO, "background resized to", tk.gocuiSize)
}
log.Log(INFO, "background resized to", a, b, c, d)
} }
// find the "BG" widget and set it to the background on the very very bottom // find the "BG" widget and set it to the background on the very very bottom
@ -288,5 +287,9 @@ func setBottomBG() {
tk.v.Clear() tk.v.Clear()
me.baseGui.SetViewOnBottom(tk.cuiName) me.baseGui.SetViewOnBottom(tk.cuiName)
w, h := me.baseGui.Size() w, h := me.baseGui.Size()
me.baseGui.SetView(tk.cuiName, -1, -1, w+1, h+1, 0) tk.gocuiSize.w0 = -1
tk.gocuiSize.h0 = -1
tk.gocuiSize.w1 = w + 1
tk.gocuiSize.h1 = h + 1
tk.SetView()
} }

View File

@ -143,7 +143,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
// tk.dumpWidget(fmt.Sprintf("PlaceGroup(%d,%d)", maxW, newH)) // tk.dumpWidget(fmt.Sprintf("PlaceGroup(%d,%d)", maxW, newH))
return maxW, newH return maxW, newH
case widget.Button: case widget.Button:
if tk.isWindowDense() && tk.isInGrid() { if tk.isDense() && tk.isInGrid() {
tk.frame = false tk.frame = false
// tk.color = nil // tk.color = nil
// tk.defaultColor = nil // tk.defaultColor = nil
@ -167,6 +167,14 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
return 0, 0 return 0, 0
} }
func (tk *guiWidget) isDense() bool {
if tk.node.InTable() {
return true
}
return tk.isWindowDense()
}
func (tk *guiWidget) isWindowDense() bool { func (tk *guiWidget) isWindowDense() bool {
if tk.WidgetType() == widget.Window { if tk.WidgetType() == widget.Window {
return tk.window.dense return tk.window.dense
@ -193,8 +201,6 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
return 0, 0 return 0, 0
} }
dense := w.isWindowDense()
w.full.w0 = startW w.full.w0 = startW
w.full.h0 = startH w.full.h0 = startH
@ -209,7 +215,7 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
if w.heights[child.GridH()] < childH { if w.heights[child.GridH()] < childH {
w.heights[child.GridH()] = childH w.heights[child.GridH()] = childH
} }
if dense { if child.isDense() {
if w.heights[child.GridH()] > 0 { if w.heights[child.GridH()] > 0 {
w.heights[child.GridH()] = 1 w.heights[child.GridH()] = 1
} else { } else {

View File

@ -16,7 +16,7 @@ func newAdd(n *tree.Node) {
return return
} }
if n.TK != nil { if n.TK != nil {
log.Warn("Tree Add() sent a widget we aleady seem to have") log.Log(INFO, "Tree Add() sent a widget we aleady seem to have")
// this is done to protect the plugin being 'refreshed' with the // this is done to protect the plugin being 'refreshed' with the
// widget binary tree. TODO: find a way to keep them in sync // widget binary tree. TODO: find a way to keep them in sync
return return
@ -162,10 +162,10 @@ func (tk *guiWidget) GetText() string {
return "" return ""
} }
// hack. use "textbox widget" to "disable" user events
func hideDisable() { func hideDisable() {
if me.textbox.tk == nil { if me.textbox.tk == nil {
initTextbox() initTextbox()
me.textbox.tk.prepTextbox()
} }
me.textbox.tk.Hide() me.textbox.tk.Hide()
@ -177,6 +177,7 @@ func hideDisable() {
// me.baseGui.DeleteView(me.textbox.tk.v.Name()) // me.baseGui.DeleteView(me.textbox.tk.v.Name())
} }
// hack. use "textbox widget" to "disable" user events
func showDisable() { func showDisable() {
if me.textbox.tk == nil { if me.textbox.tk == nil {
initTextbox() initTextbox()
@ -200,7 +201,7 @@ func showDisable() {
me.textbox.tk.v.Editable = true me.textbox.tk.v.Editable = true
me.textbox.tk.v.Wrap = true me.textbox.tk.v.Wrap = true
me.baseGui.SetView(me.textbox.tk.cuiName, r.w0, r.h0, r.w1, r.h1, 0) me.textbox.tk.SetViewRect(r)
me.baseGui.SetCurrentView(me.textbox.tk.v.Name()) me.baseGui.SetCurrentView(me.textbox.tk.v.Name())
// bind the enter key to a function so we can close the textbox // bind the enter key to a function so we can close the textbox

View File

@ -67,7 +67,7 @@ func (tk *guiWidget) Size() (int, int) {
case widget.Checkbox: case widget.Checkbox:
return len(tk.String()) + 2, 3 // TODO: compute this based on 'window dense' return len(tk.String()) + 2, 3 // TODO: compute this based on 'window dense'
case widget.Button: case widget.Button:
if tk.isWindowDense() { if tk.isDense() {
return len(tk.String()) + 2, 0 return len(tk.String()) + 2, 0
} }
return len(tk.String()) + 2, 3 // TODO: compute this based on 'window dense' return len(tk.String()) + 2, 3 // TODO: compute this based on 'window dense'
@ -244,7 +244,7 @@ func (tk *guiWidget) setFullSize() bool {
if tk.WidgetType() == widget.Button { if tk.WidgetType() == widget.Button {
tk.full.h1 = tk.full.h0 + 1 tk.full.h1 = tk.full.h0 + 1
} }
if tk.isWindowDense() && tk.isInGrid() { if tk.isDense() && tk.isInGrid() {
tk.full.h1 = tk.full.h0 tk.full.h1 = tk.full.h0
} }
if changed { if changed {
@ -309,7 +309,7 @@ func (tk *guiWidget) buttonFullSize() rectType {
tk.full.h1 = r.h1 tk.full.h1 = r.h1
// total hack. fix this somewhere eventually correctly // total hack. fix this somewhere eventually correctly
if tk.isWindowDense() { // total hack. fix this somewhere eventually correctly if tk.isDense() { // total hack. fix this somewhere eventually correctly
tk.full.h0 += 1 // total hack. fix this somewhere eventually correctly tk.full.h0 += 1 // total hack. fix this somewhere eventually correctly
tk.full.h1 = tk.full.h0 // total hack. fix this somewhere eventually correctly tk.full.h1 = tk.full.h0 // total hack. fix this somewhere eventually correctly
} }

View File

@ -4,7 +4,6 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"slices" "slices"
"strings" "strings"
@ -46,6 +45,7 @@ func coreStdout() {
me.stdout.tk = initWidget(n) me.stdout.tk = initWidget(n)
tk := me.stdout.tk tk := me.stdout.tk
tk.cuiName = "msg"
tk.gocuiSize.w0 = me.stdout.lastW tk.gocuiSize.w0 = me.stdout.lastW
tk.gocuiSize.h0 = me.stdout.lastH tk.gocuiSize.h0 = me.stdout.lastH
tk.gocuiSize.w1 = tk.gocuiSize.w0 + me.stdout.w tk.gocuiSize.w1 = tk.gocuiSize.w0 + me.stdout.w
@ -64,6 +64,9 @@ func makeOutputWidget(g *gocui.Gui, stringFromMouseClick string) *gocui.View {
return nil return nil
} }
me.stdout.tk.cuiName = "msg"
me.stdout.tk.SetView()
v, err := g.View("msg") v, err := g.View("msg")
if v == nil { if v == nil {
// log.Log(NOW, "makeoutputwindow() this is supposed to happen. v == nil", err) // log.Log(NOW, "makeoutputwindow() this is supposed to happen. v == nil", err)
@ -72,27 +75,7 @@ func makeOutputWidget(g *gocui.Gui, stringFromMouseClick string) *gocui.View {
return v return v
} }
rect := me.stdout.tk.gocuiSize v = me.stdout.tk.v
v, err = g.SetView("msg", rect.w0, rect.h0, rect.w1, rect.h1, 0)
if errors.Is(err, gocui.ErrUnknownView) {
// log.Log(NOW, "makeoutputwindow() this is supposed to happen?", err)
}
if err != nil {
if v == nil {
log.Log(NOW, "makeoutputwindow() BAD: v == nil && err =", err)
}
log.Log(NOW, "makeoutputwindow() create output window failed", err)
return nil
}
if v == nil {
log.Log(NOW, "makeoutputwindow() msg == nil. WTF now? err =", err)
return nil
} else {
me.stdout.tk.v = v
}
v.Clear() v.Clear()
v.SelBgColor = gocui.ColorCyan v.SelBgColor = gocui.ColorCyan
@ -101,16 +84,8 @@ func makeOutputWidget(g *gocui.Gui, stringFromMouseClick string) *gocui.View {
// g.SetViewOnBottom("msg") // g.SetViewOnBottom("msg")
// setBottomBG() // setBottomBG()
me.stdout.tk.v = v
me.stdout.tk.DrawAt(me.stdout.lastW, me.stdout.lastH) me.stdout.tk.DrawAt(me.stdout.lastW, me.stdout.lastH)
relocateStdoutOffscreen() relocateStdoutOffscreen()
/*
if me.stdout.outputOffscreen {
me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH)
} else {
relocateStdoutOffscreen()
}
*/
return v return v
} }
@ -128,6 +103,22 @@ func relocateStdoutOffscreen() {
} }
func (tk *guiWidget) relocateStdout(w int, h int) { func (tk *guiWidget) relocateStdout(w int, h int) {
if me.stdout.w < 8 {
me.stdout.w = 8
}
if me.stdout.h < 4 {
me.stdout.h = 4
}
if w+me.stdout.w < 2 {
w = 2
}
if h+me.stdout.h < 2 {
h = 2
}
w0 := w w0 := w
h0 := h h0 := h
w1 := w + me.stdout.w w1 := w + me.stdout.w
@ -143,8 +134,7 @@ func (tk *guiWidget) relocateStdout(w int, h int) {
tk.full.h0 = h0 tk.full.h0 = h0
tk.full.h1 = h1 tk.full.h1 = h1
me.baseGui.SetView("msg", w0, h0, w1, h1, 0) tk.SetView()
// me.baseGui.SetViewOnBottom("msg")
} }
// from the gocui devs: // from the gocui devs:
@ -221,7 +211,9 @@ func (tk *guiWidget) refreshStdout() {
// chop off the last lines in the buffer // chop off the last lines in the buffer
chop := len(me.stdout.outputS) - (me.stdout.pager + me.stdout.h) chop := len(me.stdout.outputS) - (me.stdout.pager + me.stdout.h)
cur = append(cur, me.stdout.outputS[chop:chop+me.stdout.h]...) cur = append(cur, me.stdout.outputS[chop:chop+me.stdout.h]...)
if me.stdout.reverse {
slices.Reverse(cur) slices.Reverse(cur)
}
tk.v.Clear() tk.v.Clear()
fmt.Fprintln(tk.v, strings.Join(cur, "\n")) fmt.Fprintln(tk.v, strings.Join(cur, "\n"))
} }

View File

@ -116,11 +116,11 @@ type stdout struct {
disable bool // disable the stdout window. do not change os.Stdout & os.Stderr disable bool // disable the stdout window. do not change os.Stdout & os.Stderr
lastW int // the last 'w' location (used to move from offscreen to onscreen) lastW int // the last 'w' location (used to move from offscreen to onscreen)
lastH int // the last 'h' location (used to move from offscreen to onscreen) lastH int // the last 'h' location (used to move from offscreen to onscreen)
// mouseOffsetW int // the current 'w' offset
// mouseOffsetH int // the current 'h' offset
init bool // moves the window offscreen on startup init bool // moves the window offscreen on startup
outputS []string // the buffer of all the output outputS []string // the buffer of all the output
pager int // allows the user to page through the buffer pager int // allows the user to page through the buffer
changed bool // indicates the user has changed stdout. gocui should remember the state here
reverse bool // flip the STDOUT upside down so new STDOUT lines are at the top
} }
// settings for the dropdown window // settings for the dropdown window
@ -241,6 +241,7 @@ type guiWidget struct {
color *colorT // what color to use color *colorT // what color to use
colorLast colorT // the last color the widget had colorLast colorT // the last color the widget had
defaultColor *colorT // the default colors // TODO: make a function for this instead defaultColor *colorT // the default colors // TODO: make a function for this instead
isTable bool // is this a table?
} }
// THIS IS GO COMPILER MAGIC // THIS IS GO COMPILER MAGIC

View File

@ -13,20 +13,6 @@ import (
"go.wit.com/widget" "go.wit.com/widget"
) )
/*
func initGridPB(pb *guipb.Widget) *guiWidget {
var w *guiWidget
w = new(guiWidget)
w.pb = pb
w.parent = me.treeRoot.TK.(*guiWidget)
w.wtype = widget.Window
w.cuiName = fmt.Sprintf("%d %s", pb.Id, "TK")
w.labelN = pb.Name
return w
}
*/
func initGridPB(pb *guipb.Widget) *guiWidget { func initGridPB(pb *guipb.Widget) *guiWidget {
var w *guiWidget var w *guiWidget
w = new(guiWidget) w = new(guiWidget)
@ -35,6 +21,7 @@ func initGridPB(pb *guipb.Widget) *guiWidget {
w.wtype = widget.Grid w.wtype = widget.Grid
w.cuiName = fmt.Sprintf("%d %s", pb.Id, "TK") w.cuiName = fmt.Sprintf("%d %s", pb.Id, "TK")
w.labelN = pb.Name w.labelN = pb.Name
w.isTable = true
return w return w
} }

View File

@ -7,6 +7,7 @@ package main
import ( import (
"strings" "strings"
"time"
"github.com/awesome-gocui/gocui" "github.com/awesome-gocui/gocui"
log "go.wit.com/log" log "go.wit.com/log"
@ -40,7 +41,7 @@ func initTextbox() {
func (callertk *guiWidget) prepTextbox() { func (callertk *guiWidget) prepTextbox() {
initTextbox() initTextbox()
if me.textbox.tk == nil { if me.textbox.tk == nil {
log.Log(GOCUI, "prepTextbox() Is Broken") log.Log(WARN, "prepTextbox() Is Broken")
return return
} }
@ -51,21 +52,35 @@ func (callertk *guiWidget) prepTextbox() {
r.w1 = r.w0 + 24 r.w1 = r.w0 + 24
r.h1 = r.h0 + 2 r.h1 = r.h0 + 2
me.textbox.tk.forceSizes(r) me.textbox.tk.forceSizes(r)
// me.textbox.tk.dumpWidget("after sizes") me.textbox.tk.dumpWidget("after sizes")
me.textbox.callerTK = callertk me.textbox.callerTK = callertk
// showTextbox(callertk.String()) if me.textbox.tk.v != nil {
log.Log(WARN, "WARNING textbox DeleteView()")
log.Log(WARN, "WARNING textbox DeleteView()")
log.Log(WARN, "WARNING textbox DeleteView()")
me.baseGui.DeleteView(me.textbox.tk.cuiName)
time.Sleep(time.Second)
}
if err := me.textbox.tk.SetViewRect(r); err != nil {
log.Log(WARN, "textbox SetViewRect() failed", err, "view name =", me.textbox.tk.cuiName)
return
}
// me.textbox.tk.Show() // actually makes the gocui view. TODO: redo this?
showTextbox(callertk.String())
} }
func showTextbox(callers string) { func showTextbox(callers string) {
// tk := me.textbox.tk // tk := me.textbox.tk
// me.textbox.tk.dumpWidget("after sizes") // me.textbox.tk.dumpWidget("after sizes")
log.Log(WARN, "showTextbox() caller string =", callers)
// me.textbox.tk.Show() // actually makes the gocui view. TODO: redo this // me.textbox.tk.Show() // actually makes the gocui view. TODO: redo this
if me.textbox.tk.v == nil { if me.textbox.tk.v == nil {
log.Info("wtf went wrong") log.Log(WARN, "textbox.tk.v == nil showTextbox() is broken")
return return
} }
@ -78,8 +93,8 @@ func showTextbox(callers string) {
me.textbox.tk.v.Editable = true me.textbox.tk.v.Editable = true
me.textbox.tk.v.Wrap = true me.textbox.tk.v.Wrap = true
r := me.textbox.tk.gocuiSize me.textbox.tk.SetView()
me.baseGui.SetView(me.textbox.tk.cuiName, r.w0, r.h0, r.w1, r.h1, 0)
me.baseGui.SetCurrentView(me.textbox.tk.v.Name()) me.baseGui.SetCurrentView(me.textbox.tk.v.Name())
// bind the enter key to a function so we can close the textbox // bind the enter key to a function so we can close the textbox
@ -87,7 +102,8 @@ func showTextbox(callers string) {
me.textbox.active = true me.textbox.active = true
// me.textbox.dumpWidget("showTextbox()") me.baseGui.SetViewOnTop(me.textbox.tk.v.Name())
me.textbox.tk.dumpWidget("showTextbox()")
} }
func theCloseTheTextbox(g *gocui.Gui, v *gocui.View) error { func theCloseTheTextbox(g *gocui.Gui, v *gocui.View) error {

View File

@ -41,17 +41,14 @@ func addWidget(n *tree.Node) {
switch n.WidgetType { switch n.WidgetType {
case widget.Root: case widget.Root:
log.Log(INFO, "setStartWH() rootNode w.id =", n.WidgetId, "w.name", n.String()) log.Log(INFO, "setStartWH() rootNode w.id =", n.WidgetId, "w.name", n.String())
// tk.color = &colorRoot
setFake(n) setFake(n)
return return
case widget.Flag: case widget.Flag:
// tk.color = &colorFlag
setFake(n) setFake(n)
return return
case widget.Window: case widget.Window:
tk.frame = false tk.frame = false
tk.labelN = tk.GetText() + " X" tk.labelN = tk.GetText() + " X"
// tk.setColor(&colorWindow)
me.newWindowTrigger <- tk me.newWindowTrigger <- tk
redoWindows(0, 0) redoWindows(0, 0)
return return
@ -62,7 +59,6 @@ func addWidget(n *tree.Node) {
tk.isFake = true tk.isFake = true
return return
case widget.Tab: case widget.Tab:
// tk.color = &colorTab
return return
case widget.Button: case widget.Button:
tk.setColorButton() tk.setColorButton()
@ -81,20 +77,16 @@ func addWidget(n *tree.Node) {
case widget.Textbox: case widget.Textbox:
n.State.Label = "" n.State.Label = ""
tk.labelN = " " tk.labelN = " "
// tk.color = &colorDropdown
tk.setColorInput() tk.setColorInput()
return return
case widget.Combobox: case widget.Combobox:
// tk.color = &colorCombobox
tk.setColorInput() tk.setColorInput()
return return
case widget.Box: case widget.Box:
// tk.color = &colorBox
tk.isFake = true tk.isFake = true
setFake(n) setFake(n)
return return
case widget.Grid: case widget.Grid:
// tk.color = &colorGrid
tk.isFake = true tk.isFake = true
setFake(n) setFake(n)
return return
@ -103,7 +95,17 @@ func addWidget(n *tree.Node) {
tk.frame = false tk.frame = false
return return
case widget.Label: case widget.Label:
if tk.node.InTable() {
if tk.node.State.AtH == 0 {
// this is the table header
tk.setColorLabelTable()
} else {
// todo: highlight the whole table row
tk.setColorLabel() tk.setColorLabel()
}
} else {
tk.setColorLabel()
}
tk.frame = false tk.frame = false
return return
default: default:

View File

@ -193,7 +193,7 @@ func (tk *guiWidget) drawView() {
switch tk.WidgetType() { switch tk.WidgetType() {
case widget.Button: case widget.Button:
if tk.IsEnabled() { if tk.IsEnabled() {
if tk.isWindowDense() && tk.isInGrid() { if tk.isDense() && tk.isInGrid() {
tk.setColorButtonDense() tk.setColorButtonDense()
} else { } else {
tk.setColorButton() tk.setColorButton()
@ -223,17 +223,12 @@ func (tk *guiWidget) drawView() {
log.Log(INFO, "drawView() END") log.Log(INFO, "drawView() END")
} }
// redraw the widget tree starting at this location
func (w *guiWidget) DrawAt(offsetW, offsetH int) { func (w *guiWidget) DrawAt(offsetW, offsetH int) {
// w.setColor(&colorActiveW)
w.placeWidgets(offsetW, offsetH) // compute the sizes & places for each widget w.placeWidgets(offsetW, offsetH) // compute the sizes & places for each widget
// w.dumpWidget(fmt.Sprintf("DrawAt(%d,%d)", offsetW, offsetH)) // w.dumpWidget(fmt.Sprintf("DrawAt(%d,%d)", offsetW, offsetH))
} }
func (w *guiWidget) simpleDrawAt(offsetW, offsetH int) {
// w.setColor(&colorActiveW)
w.dumpWidget("simpleDrawAt()")
}
// display the widgets in the binary tree // display the widgets in the binary tree
func (w *guiWidget) drawTree(draw bool) { func (w *guiWidget) drawTree(draw bool) {
if w == nil { if w == nil {

View File

@ -100,6 +100,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
// set the window frame below the window widget, but this resizes the window widget it seems // set the window frame below the window widget, but this resizes the window widget it seems
me.baseGui.SetViewBeneath(tk.windowFrame.cuiName, tk.cuiName, 1) me.baseGui.SetViewBeneath(tk.windowFrame.cuiName, tk.cuiName, 1)
// so now we have to resize the window frame, but this moves it to the top? // so now we have to resize the window frame, but this moves it to the top?
me.baseGui.SetView(tk.windowFrame.cuiName, tk.windowFrame.full.w0, tk.windowFrame.full.h0, tk.windowFrame.full.w1, tk.windowFrame.full.h1, 0) me.baseGui.SetView(tk.windowFrame.cuiName, tk.windowFrame.full.w0, tk.windowFrame.full.h0, tk.windowFrame.full.w1, tk.windowFrame.full.h1, 0)
@ -209,13 +210,6 @@ func (tk *guiWidget) makeWindowActive() {
tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0) tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
/*
// print out the window list
for _, tk := range me.allwin {
log.Info("makeWindowActive() Window", tk.labelN, tk.window.active, tk.window.order)
}
*/
} }
func (tk *guiWidget) makeTK(ddItems []string) { func (tk *guiWidget) makeTK(ddItems []string) {
@ -226,25 +220,7 @@ func (tk *guiWidget) makeTK(ddItems []string) {
tk.gocuiSize.w1 = 120 tk.gocuiSize.w1 = 120
tk.gocuiSize.h0 = 15 tk.gocuiSize.h0 = 15
tk.gocuiSize.h1 = 18 tk.gocuiSize.h1 = 18
/*
var err error
tk.v, err = me.baseGui.SetView(tk.cuiName,
tk.gocuiSize.w0,
tk.gocuiSize.h0,
tk.gocuiSize.w1,
tk.gocuiSize.h1, 0)
if err != nil {
log.Info("makeTK() err", err)
return
}
if tk.v == nil {
return
}
tk.v.Wrap = true
tk.v.Frame = true
tk.v.Clear()
fmt.Fprint(tk.v, items)
*/
tk.Show() tk.Show()
} }