NODE: climbing up the rabbit hole more
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
23e471d9c1
commit
26fba883a7
7
main.go
7
main.go
|
@ -26,13 +26,16 @@ func Queue(f func()) {
|
|||
func ExampleWindow() {
|
||||
log.Println("START gui.ExampleWindow()")
|
||||
|
||||
title := "Test Window"
|
||||
Config.Title = "ExampleWindow"
|
||||
/*
|
||||
node := InitWindow(nil, nil, title, 0)
|
||||
box := node.box
|
||||
window := box.Window
|
||||
log.Println("box =", box)
|
||||
log.Println("window =", window)
|
||||
*/
|
||||
node := NewWindow()
|
||||
node.AddDebugTab("jcarr Debug")
|
||||
|
||||
window.UiWindow.Show()
|
||||
// window.UiWindow.Show()
|
||||
}
|
||||
|
|
4
table.go
4
table.go
|
@ -98,7 +98,9 @@ func InitColumns(mh *TableData, parts []TableColumnData) {
|
|||
}
|
||||
|
||||
func AddTableTab(gw *GuiWindow, name string, rowcount int, parts []TableColumnData) *TableData {
|
||||
node := InitWindow(nil, gw, name, Yaxis)
|
||||
// node := InitWindow(nil, gw, name, Yaxis)
|
||||
node := NewWindow()
|
||||
// node.AddDebugTab("jcarr Debug")
|
||||
|
||||
return AddTableBox(node.box, name, rowcount, parts)
|
||||
}
|
||||
|
|
|
@ -14,15 +14,20 @@ var nodeNames = make([]string, 100)
|
|||
func DebugWindow() {
|
||||
log.Println("START gui.DebugWindow()")
|
||||
|
||||
/*
|
||||
title := "WIT GUI Debug Window"
|
||||
node := InitWindow(nil, nil, title, 0)
|
||||
box := node.box
|
||||
window := box.Window
|
||||
log.Println("box =", box)
|
||||
log.Println("window =", window)
|
||||
*/
|
||||
|
||||
Config.Title = "replace InitWindow()"
|
||||
node := NewWindow()
|
||||
node.AddDebugTab("WIT GUI Debug Tab")
|
||||
|
||||
window.UiWindow.Show()
|
||||
// window.UiWindow.Show()
|
||||
}
|
||||
|
||||
// TODO: remove this crap
|
||||
|
|
13
window.go
13
window.go
|
@ -4,7 +4,7 @@ import (
|
|||
"log"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
// "time"
|
||||
|
||||
"github.com/andlabs/ui"
|
||||
|
||||
|
@ -13,21 +13,25 @@ import (
|
|||
_ "github.com/andlabs/ui/winmanifest"
|
||||
)
|
||||
|
||||
/*
|
||||
func initUI(name string, callback func(*GuiBox) *GuiBox) {
|
||||
ui.Main(func() {
|
||||
log.Println("gui.initUI() inside ui.Main()")
|
||||
|
||||
node := InitWindow(nil, nil, "StartNewWindow"+name, 0)
|
||||
node := NewWindow()
|
||||
|
||||
// node := InitWindow(nil, nil, "StartNewWindow"+name, 0)
|
||||
box := node.box
|
||||
box = callback(box)
|
||||
window := box.Window
|
||||
node.window = window
|
||||
log.Println("StartNewWindow() box =", box)
|
||||
|
||||
window.UiWindow.Show()
|
||||
})
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
func StartNewWindow(bg bool, name string, axis int, callback func(*GuiBox) *GuiBox) {
|
||||
log.Println("StartNewWindow() ui.Main() Create a new window")
|
||||
|
||||
|
@ -38,6 +42,7 @@ func StartNewWindow(bg bool, name string, axis int, callback func(*GuiBox) *GuiB
|
|||
initUI(name, callback)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func MessageWindow(gw *GuiWindow, msg1 string, msg2 string) {
|
||||
ui.MsgBox(gw.UiWindow, msg1, msg2)
|
||||
|
@ -52,6 +57,7 @@ func ErrorWindow(gw *GuiWindow, msg1 string, msg2 string) {
|
|||
// This is this way because on Linux you can have more than one
|
||||
// actual window but that does not appear to work on the MacOS or Windows
|
||||
//
|
||||
/*
|
||||
func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
|
||||
log.Println("gui.InitWindow() START")
|
||||
|
||||
|
@ -178,6 +184,7 @@ func InitWindow(parent *Node, gw *GuiWindow, name string, axis int) *Node {
|
|||
}
|
||||
return node
|
||||
}
|
||||
*/
|
||||
|
||||
func DeleteWindow(name string) {
|
||||
log.Println("gui.DeleteWindow() START name =", name)
|
||||
|
|
Loading…
Reference in New Issue