summaryrefslogtreecommitdiff
path: root/nocui/event.go
blob: 97f2aed39155230e35e3690a9126e44da3a36cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main

import (
	"go.wit.com/log"
	"go.wit.com/gui/widget"
)

func (n *node) doWidgetClick() {
	switch n.WidgetType {
	case widget.Root:
		// THIS IS THE BEGINING OF THE LAYOUT
		// rootNode.nextW = 0
		// rootNode.nextH = 0
		// rootNode.redoTabs(true)
	case widget.Flag:
		// me.rootNode.redoColor(true)
		// rootNode.dumpTree(true)
	case widget.Window:
		// setCurrentWindow(w)
		n.doUserEvent()
	case widget.Tab:
		// setCurrentTab(w)
	case widget.Group:
		// n.placeWidgets()
		// n.toggleTree()
	case widget.Checkbox:
		if widget.GetBool(n.value) {
			// n.setCheckbox(false)
		} else {
			// n.setCheckbox(true)
		}
		n.doUserEvent()
	case widget.Grid:
		// rootNode.hideWidgets()
		// n.placeGrid()
		// n.showWidgets()
	case widget.Box:
		// n.showWidgetPlacement(logNow, "drawTree()")
		if widget.GetBool(n.value) {
			log.Log(NOW, "BOX IS HORIZONTAL", n.progname)
		} else {
			log.Log(NOW, "BOX IS VERTICAL", n.progname)
		}
	case widget.Button:
		n.doUserEvent()
	default:
	}
}