summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-07 03:51:23 -0600
committerJeff Carr <[email protected]>2025-02-07 03:51:23 -0600
commitb6b5df6a18f03822e26a426bf624d1ca7ccbf354 (patch)
treeb2b7ddbae9780712fb9e79e17e39afdb0e10cc38
parent13a194dca5d9c6153772d2ef4e1f5ce93f191c6d (diff)
forge is finally an app again. this time in the consolev0.22.17
-rw-r--r--eventBindings.go33
-rw-r--r--eventMouse.go20
-rw-r--r--init.go6
-rw-r--r--stdoutShow.go2
-rw-r--r--window.go52
5 files changed, 55 insertions, 58 deletions
diff --git a/eventBindings.go b/eventBindings.go
index 121f95f..b309142 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -5,7 +5,6 @@ package main
import (
"fmt"
- "strings"
"syscall"
"github.com/awesome-gocui/gocui"
@@ -64,34 +63,6 @@ func theSuperMouse(g *gocui.Gui, v *gocui.View) error {
return nil
}
-func (tk *guiWidget) makeTK(ddItems []string) {
- items := strings.Join(ddItems, "\n")
- var err error
- tk.labelN = items
- tk.SetText(items)
- tk.gocuiSize.w0 = 100
- tk.gocuiSize.w1 = 120
- tk.gocuiSize.h0 = 15
- tk.gocuiSize.h1 = 18
- 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()
-}
-
/*
func addDropdown() *tree.Node {
return addDropdownNew(-222)
@@ -172,12 +143,12 @@ func theStdout(g *gocui.Gui, v *gocui.View) error {
if me.stdout.outputOnTop {
if me.stdout.outputOffscreen {
me.stdout.outputOffscreen = false
- log.Info(fmt.Sprintf("set stdout off screen pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
+ log.Info(fmt.Sprintf("stdout moved off screen pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
relocateStdoutOffscreen()
return nil
} else {
me.stdout.outputOffscreen = true
- log.Info("set stdout on screen here")
+ log.Info(fmt.Sprintf("stdout moved on screen pager=%d len(%d)", me.stdout.pager, len(me.stdout.outputS)))
}
// move the stdout window back onscreen
me.stdout.tk.relocateStdout(me.stdout.lastW, me.stdout.lastH)
diff --git a/eventMouse.go b/eventMouse.go
index 4c779cb..f2e1a92 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -43,7 +43,7 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
log.Info("mouseDown() stopping here. dropdwon menu is in effect")
for _, tk := range findByXY(w, h) {
if (tk.node.WidgetType == widget.Flag) && (tk == me.dropdown.tk) {
- log.Info("SENDING CLICK TO Flag (dropdown)")
+ // log.Info("SENDING CLICK TO Flag (dropdown)")
tk.doWidgetClick(w, h)
me.dropdown.active = false
return nil
@@ -80,45 +80,39 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
for _, tk := range tk.findByXYreal(w, h) {
// tk.dumpWidget("mouseDown()")
if tk.node.WidgetType == widget.Button {
- log.Info("SENDING CLICK TO Button")
+ // log.Info("SENDING CLICK TO Button")
tk.doWidgetClick(w, h)
return nil
}
if tk.node.WidgetType == widget.Checkbox {
- log.Info("SENDING CLICK TO Checkbox")
+ // log.Info("SENDING CLICK TO Checkbox")
tk.doWidgetClick(w, h)
return nil
}
if tk.node.WidgetType == widget.Dropdown {
- log.Info("SENDING CLICK TO Dropdown")
+ // log.Info("SENDING CLICK TO Dropdown")
tk.doWidgetClick(w, h)
return nil
}
if tk.node.WidgetType == widget.Textbox {
- log.Info("SENDING CLICK TO Textbox")
+ // log.Info("SENDING CLICK TO Textbox")
tk.doWidgetClick(w, h)
return nil
}
}
}
if tk.node.WidgetType == widget.Stdout {
- tk.dumpWidget("stdout fixme drag()" + tk.labelN)
+ // tk.dumpWidget("stdout fixme drag()" + tk.labelN)
me.currentDrag = tk
tk.dragW = w - tk.gocuiSize.w0
tk.dragH = h - tk.gocuiSize.h0
- // tk.doWidgetClick(w-tk.dragW, w-tk.dragH)
return nil
}
- tk.dumpWidget("mouse drag()" + tk.labelN)
+ // tk.dumpWidget("mouse drag()" + tk.labelN)
me.currentDrag = tk
tk.dragW = w - tk.gocuiSize.w0
tk.dragH = h - tk.gocuiSize.h0
- // tk.doWidgetClick(w-tk.dragW, w-tk.dragH)
return nil
-
- // move the msg I guess
- // return msgDown(g, v)
- // return nil
}
/*
diff --git a/init.go b/init.go
index 8bff631..000e6f0 100644
--- a/init.go
+++ b/init.go
@@ -202,10 +202,10 @@ func gocuiMain() {
func newWindowTrigger() {
log.Log(NOW, "newWindowTriggerl() START")
for {
- log.Log(NOW, "newWindowTrigger() for loop")
+ // log.Log(NOW, "GO plugin toolkit made a new window")
select {
case tk := <-me.newWindowTrigger:
- log.Log(NOW, "newWindowTrigger() got new window", tk.cuiName)
+ // log.Log(NOW, "newWindowTrigger() got new window", tk.cuiName)
time.Sleep(200 * time.Millisecond)
redoWindows(1, -1)
if !me.stdout.init {
@@ -215,7 +215,7 @@ func newWindowTrigger() {
tk.makeWindowActive()
tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
- log.Log(NOW, "newWindowTrigger() after sleep")
+ // log.Log(NOW, "newWindowTrigger() after sleep")
}
}
}
diff --git a/stdoutShow.go b/stdoutShow.go
index 24f1e66..41c7bcf 100644
--- a/stdoutShow.go
+++ b/stdoutShow.go
@@ -103,7 +103,7 @@ func relocateStdoutOffscreen() {
return
}
log.CaptureMode(me.stdout.tk)
- log.Log(ERROR, "setting log.CaptureMode(tk.v) in relocateStdoutOffscreen()")
+ // log.Log(ERROR, "setting log.CaptureMode(tk.v) in relocateStdoutOffscreen()")
newW := 10
newH := 0 - me.stdout.h - 4
me.stdout.tk.relocateStdout(newW, newH)
diff --git a/window.go b/window.go
index db93581..c340d99 100644
--- a/window.go
+++ b/window.go
@@ -5,8 +5,8 @@ package main
import (
"fmt"
+ "strings"
- log "go.wit.com/log"
"go.wit.com/toolkits/tree"
"go.wit.com/widget"
)
@@ -48,13 +48,15 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
tk.full.h0 = tk.force.h0
tk.setFullSize()
- 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("crap. got an err", err)
- }
- if tk.v != v {
- log.Info("crap. got another problem v != tk.v")
- }
+ /*
+ 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("crap. got an err", err)
+ }
+ if tk.v != v {
+ log.Info("crap. got another problem v != tk.v")
+ }
+ */
tk.Show()
tk.v.Clear()
fmt.Fprint(tk.v, "ZZZ"+tk.GetText())
@@ -95,7 +97,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
// re-draws the buttons for each of the windows
func redoWindows(nextW int, nextH int) {
for _, tk := range findWindows() {
- tk.dumpWidget(fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH))
+ // tk.dumpWidget(fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH))
if tk.window.wasDragged {
// don't move windows around the user has dragged to a certain location
tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
@@ -109,7 +111,7 @@ func redoWindows(nextW int, nextH int) {
// probably a new window?
tk.redrawWindow(nextW, nextH)
}
- tk.dumpWidget(fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH))
+ // tk.dumpWidget(fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH))
// increment the width for the next window
nextW += tk.gocuiSize.Width() + 10
@@ -182,3 +184,33 @@ func (tk *guiWidget) makeWindowActive() {
}
*/
}
+
+func (tk *guiWidget) makeTK(ddItems []string) {
+ items := strings.Join(ddItems, "\n")
+ tk.labelN = items
+ tk.SetText(items)
+ tk.gocuiSize.w0 = 100
+ tk.gocuiSize.w1 = 120
+ tk.gocuiSize.h0 = 15
+ 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()
+}