NODE: more rabbits
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
2133a00c6b
commit
2ec7fc29b0
4
main.go
4
main.go
|
@ -12,7 +12,7 @@ func Main(f func()) {
|
||||||
ui.Main(f)
|
ui.Main(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Other goroutines must use this
|
// Other goroutines must use this to access the GUI
|
||||||
//
|
//
|
||||||
// You can not acess / process the GUI thread directly from
|
// You can not acess / process the GUI thread directly from
|
||||||
// other goroutines. This is due to the nature of how
|
// other goroutines. This is due to the nature of how
|
||||||
|
@ -23,6 +23,7 @@ func Queue(f func()) {
|
||||||
ui.QueueMain(f)
|
ui.QueueMain(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func ExampleWindow() {
|
func ExampleWindow() {
|
||||||
log.Println("START gui.ExampleWindow()")
|
log.Println("START gui.ExampleWindow()")
|
||||||
|
|
||||||
|
@ -30,3 +31,4 @@ func ExampleWindow() {
|
||||||
node := NewWindow()
|
node := NewWindow()
|
||||||
node.AddDebugTab("jcarr Debug")
|
node.AddDebugTab("jcarr Debug")
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -35,7 +35,9 @@ func makeWindowDebug() ui.Control {
|
||||||
cbox := ui.NewCombobox()
|
cbox := ui.NewCombobox()
|
||||||
|
|
||||||
for name, _ := range Data.WindowMap {
|
for name, _ := range Data.WindowMap {
|
||||||
|
if (Config.Debug) {
|
||||||
log.Println("range Data.WindowMap() name =", name)
|
log.Println("range Data.WindowMap() name =", name)
|
||||||
|
}
|
||||||
addName(cbox, name)
|
addName(cbox, name)
|
||||||
}
|
}
|
||||||
cbox.SetSelected(0)
|
cbox.SetSelected(0)
|
||||||
|
@ -153,7 +155,9 @@ func makeWindowDebug() ui.Control {
|
||||||
nodeCombo := ui.NewCombobox()
|
nodeCombo := ui.NewCombobox()
|
||||||
|
|
||||||
for name, node := range Data.NodeMap {
|
for name, node := range Data.NodeMap {
|
||||||
|
if (Config.Debug) {
|
||||||
log.Println("range Data.NodeMap() name =", name)
|
log.Println("range Data.NodeMap() name =", name)
|
||||||
|
}
|
||||||
addNodeName(nodeCombo, node.id)
|
addNodeName(nodeCombo, node.id)
|
||||||
}
|
}
|
||||||
nodeCombo.SetSelected(0)
|
nodeCombo.SetSelected(0)
|
||||||
|
|
12
window.go
12
window.go
|
@ -52,6 +52,7 @@ func DeleteWindow(name string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func CreateWindow(title string, tabname string, x int, y int, custom func() ui.Control) *Node {
|
func CreateWindow(title string, tabname string, x int, y int, custom func() ui.Control) *Node {
|
||||||
n := CreateBlankWindow(title, x, y)
|
n := CreateBlankWindow(title, x, y)
|
||||||
if (n.box == nil) {
|
if (n.box == nil) {
|
||||||
|
@ -64,7 +65,9 @@ func CreateWindow(title string, tabname string, x int, y int, custom func() ui.C
|
||||||
// TODO: run custom() here // Oct 9
|
// TODO: run custom() here // Oct 9
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
func (n *Node) Add(e Element) *Node {
|
func (n *Node) Add(e Element) *Node {
|
||||||
newNode := n.addNode("testingAdd")
|
newNode := n.addNode("testingAdd")
|
||||||
if(e == Tab) {
|
if(e == Tab) {
|
||||||
|
@ -72,12 +75,14 @@ func (n *Node) Add(e Element) *Node {
|
||||||
}
|
}
|
||||||
return newNode
|
return newNode
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create a new node
|
// Create a new node
|
||||||
// if parent == nil, that means it is a new window and needs to be put
|
// if parent == nil, that means it is a new window and needs to be put
|
||||||
// in the window map (aka Data.NodeMap)
|
// in the window map (aka Data.NodeMap)
|
||||||
//
|
//
|
||||||
|
/*
|
||||||
func (parent *Node) addNode(title string) *Node {
|
func (parent *Node) addNode(title string) *Node {
|
||||||
var node Node
|
var node Node
|
||||||
node.Name = title
|
node.Name = title
|
||||||
|
@ -92,6 +97,7 @@ func (parent *Node) addNode(title string) *Node {
|
||||||
parent.Append(&node)
|
parent.Append(&node)
|
||||||
return &node
|
return &node
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func makeNode(parent *Node, title string, x int, y int) *Node {
|
func makeNode(parent *Node, title string, x int, y int) *Node {
|
||||||
var node Node
|
var node Node
|
||||||
|
@ -106,9 +112,9 @@ func makeNode(parent *Node, title string, x int, y int) *Node {
|
||||||
// panic("gui.makeNode() START")
|
// panic("gui.makeNode() START")
|
||||||
if (parent == nil) {
|
if (parent == nil) {
|
||||||
if (Data.NodeMap[title] != nil) {
|
if (Data.NodeMap[title] != nil) {
|
||||||
log.Println("Duplicate uiNewWindow() name =", title)
|
log.Println("Duplicate window name =", title)
|
||||||
// TODO: just change the 'title' to something unique
|
// TODO: just change the 'title' to something unique
|
||||||
panic(fmt.Sprintf("Duplicate uiNewWindow() name = %s\n", title))
|
panic(fmt.Sprintf("Duplicate window name = %s\n", title))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// panic("gui.makeNode() before NodeMap()")
|
// panic("gui.makeNode() before NodeMap()")
|
||||||
|
@ -161,6 +167,7 @@ func (n *Node) uiNewWindow(title string, x int, y int) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func CreateBlankWindow(title string, x int, y int) *Node {
|
func CreateBlankWindow(title string, x int, y int) *Node {
|
||||||
node := mapWindow(nil, nil, title, x, y)
|
node := mapWindow(nil, nil, title, x, y)
|
||||||
box := node.box
|
box := node.box
|
||||||
|
@ -178,6 +185,7 @@ func CreateBlankWindow(title string, x int, y int) *Node {
|
||||||
box.Window.UiWindow = window
|
box.Window.UiWindow = window
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
func (n *Node) initBlankWindow() ui.Control {
|
func (n *Node) initBlankWindow() ui.Control {
|
||||||
|
|
Loading…
Reference in New Issue