diff options
Diffstat (limited to 'eventMouseClick.go')
| -rw-r--r-- | eventMouseClick.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go index 526cbbe..8d33800 100644 --- a/eventMouseClick.go +++ b/eventMouseClick.go @@ -27,10 +27,6 @@ func (tk *guiWidget) doWidgetClick(w int, h int) { me.currentWindow.isCurrent = true tk.active = false - full := tk.getFullSize() - tk.gocuiSize.w1 = full.w1 - tk.gocuiSize.h1 = full.h1 - // draw the current window w := tk.gocuiSize.w0 + 4 h := tk.gocuiSize.h0 + 4 @@ -38,6 +34,11 @@ func (tk *guiWidget) doWidgetClick(w int, h int) { tk.setColor(&colorActiveW) tk.showWidgets() tk.placeWidgets(w, h) // compute the sizes & places for each widget + + full := tk.getFullSize() + tk.gocuiSize.w1 = full.w1 + tk.gocuiSize.h1 = full.h1 + me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0) case widget.Group: if tk.active { tk.active = false @@ -116,6 +117,14 @@ func click(g *gocui.Gui, v *gocui.View) error { } } + // Button widgets + for _, tk := range findByXY(w, h) { + if tk.node.WidgetType == widget.Button { + tk.doWidgetClick(w, h) + return nil + } + } + for _, tk := range findByXY(w, h) { // will show you everything found on a mouse click. great for debugging! // tk.dumpWidget("click()") |
