diff --git a/main.go b/main.go index 1eada56..b8bc288 100644 --- a/main.go +++ b/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() } diff --git a/table.go b/table.go index a6bb84e..ff31a68 100644 --- a/table.go +++ b/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) } diff --git a/window-debug.go b/window-debug.go index 69eb7bb..9e5dc1b 100644 --- a/window-debug.go +++ b/window-debug.go @@ -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 diff --git a/window.go b/window.go index 73ccad3..c2bf34b 100644 --- a/window.go +++ b/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)