summaryrefslogtreecommitdiff
path: root/toolkit/gocui/mouse.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-24 06:22:14 -0500
committerJeff Carr <[email protected]>2023-04-24 06:22:14 -0500
commitd38b05d2d5a2c2ff0c66b541f7d80cbd1c250d76 (patch)
tree5c0540c8efac7cf59fefc2624bf8de5654a7393f /toolkit/gocui/mouse.go
parentfbe943540106f1c12971932fd92f9395bbe214b3 (diff)
gocui: always show STDOUT
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/mouse.go')
-rw-r--r--toolkit/gocui/mouse.go29
1 files changed, 12 insertions, 17 deletions
diff --git a/toolkit/gocui/mouse.go b/toolkit/gocui/mouse.go
index 4337f42..0ad8e29 100644
--- a/toolkit/gocui/mouse.go
+++ b/toolkit/gocui/mouse.go
@@ -35,33 +35,28 @@ func MouseMain() {
func layout(g *gocui.Gui) error {
maxX, maxY := g.Size()
+ mx, my := g.MousePosition()
if _, err := g.View("msg"); msgMouseDown && err == nil {
moveMsg(g)
}
- if v, err := g.SetView("global", -1, -1, maxX, maxY, 0); err != nil {
+ // if v, err := g.SetView("global", -1, -1, maxX, maxY, 0); err != nil {
+ // what is this do? I made it just the top 2 lines for now. Is this useful for something?
+ if v, err := g.SetView("global", -1, -1, maxX, 2, 10); err != nil {
if !errors.Is(err, gocui.ErrUnknownView) {
+ log("global failed", maxX, maxY)
return err
}
v.Frame = false
}
- /*
- if v, err := g.SetView("but1", 2, 2, 22, 7, 0); err != nil {
- if !errors.Is(err, gocui.ErrUnknownView) {
- return err
- }
- v.SelBgColor = gocui.ColorGreen
- v.SelFgColor = gocui.ColorBlack
- fmt.Fprintln(v, "Button 1 - line 1")
- fmt.Fprintln(v, "Button 1 - line 2")
- fmt.Fprintln(v, "Button 1 - line 3")
- fmt.Fprintln(v, "Button 1 - line 4")
- if _, err := g.SetCurrentView("but1"); err != nil {
- return err
- }
- }
- */
helplayout(g)
+ if widgetView, _ := g.View("msg"); widgetView == nil {
+ log(logInfo, "create output widget now", maxX, maxY, mx, my)
+ makeOutputWidget(g, "this is a create before a mouse click")
+ } else {
+ log(logInfo, "output widget already exists", maxX, maxY, mx, my)
+ }
updateHighlightedView(g)
+ log(logInfo, "layout() END", maxX, maxY, mx, my)
return nil
}