summaryrefslogtreecommitdiff
path: root/eventMouseClick.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouseClick.go')
-rw-r--r--eventMouseClick.go64
1 files changed, 0 insertions, 64 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go
index 3f907d9..08f2e6f 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -10,76 +10,12 @@ import (
"go.wit.com/widget"
)
-/*
-// this didn't work. panic()
-func (tk *guiWidget) DeleteNode() {
- p := tk.parent
- for i, child := range p.children {
- log.Log(GOCUI, "parent has child:", i, child.node.WidgetId, child.node.GetProgName())
- if tk == child {
- log.Log(GOCUI, "Found child ==", i, child.node.WidgetId, child.node.GetProgName())
- log.Log(GOCUI, "Found n ==", i, tk.node.WidgetId, tk.node.GetProgName())
- p.children = append(p.children[:i], p.children[i+1:]...)
- }
- }
- for i, child := range p.children {
- log.Log(TREE, "parent now has child:", i, child.WidgetId, child.GetProgName())
- }
-}
-*/
-
-func (tk *guiWidget) doWindowClick() {
- w, h := me.baseGui.MousePosition()
- tk.dumpWidget(fmt.Sprintf("doWindowClick(%d,%d)", w, h))
-
- // compare the mouse location to the 'X' indicator to close the window
- if tk.gocuiSize.inRect(w, h) {
- offset := w - tk.gocuiSize.w1
- if (offset < 2) && (offset > -2) {
- // close enough // close the window here
- tk.dumpWidget(fmt.Sprintf("Close Window(%d,%d) (off=%d)", w, h, offset))
- tk.hideWindow()
- n := tk.node
- tk.deleteNode()
- me.myTree.SendWindowCloseEvent(n)
- /*
- n.DeleteNode()
-
- tk.DeleteNode()
- */
- return
- }
- if tk.window.collapsed {
- tk.dumpWidget(fmt.Sprintf("collapse = false"))
- tk.window.collapsed = false
- } else {
- tk.dumpWidget(fmt.Sprintf("collapse = true"))
- tk.window.collapsed = true
- }
- } else {
- tk.window.collapsed = false
- }
- // if there is a current window, hide it
- if me.currentWindow != nil {
- me.currentWindow.setColor(&colorWindow)
- }
-
- // now set this window as the current window
- me.currentWindow = tk
-
- tk.redrawWindow(w, h)
- setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
-}
-
// this whole things was impossible to make but it got me where I am now
// the debugging is way way better now with it being visible in the Stdout window
// so now it's possible to redo all this and make it better
func (tk *guiWidget) doWidgetClick(w int, h int) {
tk.dumpWidget(fmt.Sprintf("doWidgetClick(%d,%d)", w, h))
switch tk.node.WidgetType {
- case widget.Window:
- tk.doWindowClick()
- return
case widget.Checkbox:
if tk.node.State.Checked {
log.Log(WARN, "checkbox is being set to false")