summaryrefslogtreecommitdiff
path: root/toolkit/nocui/widget.go
blob: 71629aff5fe9521893793b9eb604951060c101ad (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
package main

import (
	"go.wit.com/gui/toolkit"
)

// this is specific to the nocui toolkit
func initWidget(n *node) *guiWidget {
	var w *guiWidget
	w = new(guiWidget)
	// Set(w, "default")

	if n.WidgetType == toolkit.Root {
		log(logInfo, "setupWidget() FOUND ROOT w.id =", n.WidgetId)
		n.WidgetId = 0
		me.rootNode = n
		return w
	}

	if (n.WidgetType == toolkit.Box) {
		if (n.B) {
			n.horizontal = true
		} else {
			n.horizontal = false
		}
	}

	return w
}