summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventBindings.go20
-rw-r--r--eventMouseClick.go3
-rw-r--r--eventMouseMove.go28
-rw-r--r--find.go6
4 files changed, 19 insertions, 38 deletions
diff --git a/eventBindings.go b/eventBindings.go
index d32f1b2..727ee70 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -79,24 +79,24 @@ func (tk *guiWidget) verifyRect() bool {
// return false
}
var ok bool = true
- if vw0 != tk.gocuiSize.w0 {
+ if vw0 != tk.full.w0 {
// log.Info("verifyRect() FIXING w0", tk.cuiName, vw0, vw1, vh0, vh1, tk.gocuiSize.w0, "w0 =", vw0)
- tk.gocuiSize.w0 = vw0
+ tk.full.w0 = vw0
ok = false
}
- if vw1 != tk.gocuiSize.w1 {
+ if vw1 != tk.full.w1 {
// log.Info("verifyRect() FIXING w1", tk.cuiName, vw0, vw1, vh0, vh1, tk.gocuiSize.w1, "w1 =", vw1)
- tk.gocuiSize.w1 = vw1
+ tk.full.w1 = vw1
ok = false
}
- if vh0 != tk.gocuiSize.h0 {
+ if vh0 != tk.full.h0 {
// log.Info("verifyRect() FIXING h0", tk.cuiName, vw0, vw1, vh0, vh1, tk.gocuiSize.h0)
- tk.gocuiSize.h0 = vh0
+ tk.full.h0 = vh0
ok = false
}
- if vh1 != tk.gocuiSize.h1 {
+ if vh1 != tk.full.h1 {
// log.Info("verifyRect() FIXING h1", tk.cuiName, vw0, vw1, vh0, vh1, tk.gocuiSize.h1)
- tk.gocuiSize.h1 = vh1
+ tk.full.h1 = vh1
ok = false
}
if !ok {
@@ -145,9 +145,9 @@ var notsure *guiWidget
func theNotsure(g *gocui.Gui, v *gocui.View) error {
log.Info("got keypress 2. now what?")
wRoot := me.treeRoot.TK.(*guiWidget)
- wRoot.redoWindows(0, 0)
- // closes anything under your mouse
w, h := g.MousePosition()
+ wRoot.redoWindows(w, h)
+ // closes anything under your mouse
if notsure == nil {
// notsure = makeDropdownView("addWidget() notsure")
notsure = addDropdownTK(-118)
diff --git a/eventMouseClick.go b/eventMouseClick.go
index 2ad7274..6ebd800 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -13,8 +13,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
if tk.node.WidgetType != widget.Window {
return
}
- // might make the green box the right size
- tk.setFullSize()
+ tk.setFullSize() // might make the green box the right size
// draw the current window
// w = tk.gocuiSize.w0 + 4
diff --git a/eventMouseMove.go b/eventMouseMove.go
index 4402219..e410f1d 100644
--- a/eventMouseMove.go
+++ b/eventMouseMove.go
@@ -92,40 +92,28 @@ func mouseMove(g *gocui.Gui) {
func (tk *guiWidget) moveNew() {
w, h := me.baseGui.MousePosition()
if tk.node.WidgetType == widget.Window {
- /*
- w1, h1 := tk.Size()
- g.SetView(tk.cuiName, w, h, w+w1, h+h1, 0)
- tk.verifyRect()
- s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
- */
- tk.gocuiSize.w0 = w
- tk.gocuiSize.h0 = h
+ tk.DrawAt(w, h)
tk.redrawWindow(w, h)
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
tk.dumpWidget(s)
return
}
if tk.node.WidgetType == widget.Flag {
- // outputW, outputH := tk.Size()
- // g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW+20, h-yOffset+outputH+me.FramePadH+20, 0)
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)
- // me.startOutputW = w - xOffset
- // me.startOutputH = h - yOffset
- // g.SetViewOnBottom(tk.cuiName)
return
} else {
// log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType)
+ // tk.dumpWidget("moveNew() MSG" + tk.cuiName)
+ outputW := 180
+ outputH := 40
+ me.baseGui.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0)
+ me.startOutputW = w - xOffset
+ me.startOutputH = h - yOffset
+ me.baseGui.SetViewOnBottom("msg")
}
- // tk.dumpWidget("moveNew() MSG" + tk.cuiName)
- outputW := 180
- outputH := 40
- me.baseGui.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0)
- me.startOutputW = w - xOffset
- me.startOutputH = h - yOffset
- me.baseGui.SetViewOnBottom("msg")
}
func createStdout(g *gocui.Gui) bool {
diff --git a/find.go b/find.go
index 6982f2e..1c8deb9 100644
--- a/find.go
+++ b/find.go
@@ -61,12 +61,6 @@ func (tk *guiWidget) findByXYreal(w int, h int) []*guiWidget {
func (tk *guiWidget) setFullSize() rectType {
r := tk.getFullSize()
- /*
- r.w0 = tk.gocuiSize.w0
- r.w1 = tk.gocuiSize.w1
- r.h0 = tk.gocuiSize.h0
- r.h1 = tk.gocuiSize.h1
- */
var changed bool
if tk.full.w0 != r.w0 {
tk.full.w0 = r.w0