From dbbffdffa3ea907db7343c9e01a3dc25f4b8cf8b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 17 Oct 2022 16:55:30 -0500 Subject: [PATCH] remove old code Signed-off-by: Jeff Carr --- debug-window.go | 13 ----- window-demo-andlabs-ui.go | 99 --------------------------------------- window.go | 2 +- 3 files changed, 1 insertion(+), 113 deletions(-) delete mode 100644 window-demo-andlabs-ui.go diff --git a/debug-window.go b/debug-window.go index e555cfa..28a4a3c 100644 --- a/debug-window.go +++ b/debug-window.go @@ -2,8 +2,6 @@ package gui import ( "log" - // "fmt" - "strconv" "github.com/andlabs/ui" _ "github.com/andlabs/ui/winmanifest" @@ -243,17 +241,6 @@ func makeWindowDebug() *ui.Box { } }) - n1 = addButton(vbox, "Node.DemoAndlabsUiTab") - n1.OnClicked(func(*ui.Button) { - y := nodeCombo.Selected() - log.Println("y =", y) - log.Println("nodeNames[y] =", nodeNames[y]) - node := Data.findId(nodeNames[y]) - if (node != nil) { - node.DemoAndlabsUiTab("ran gui.AddDemoAndlabsUiTab() " + strconv.Itoa(Config.counter)) - } - }) - return hbox } diff --git a/window-demo-andlabs-ui.go b/window-demo-andlabs-ui.go deleted file mode 100644 index 13c769c..0000000 --- a/window-demo-andlabs-ui.go +++ /dev/null @@ -1,99 +0,0 @@ -package gui - -import "log" -import "github.com/andlabs/ui" -import _ "github.com/andlabs/ui/winmanifest" - -func AndlabsUiDemoWindow() { - var w *Node - log.Println("ToolkitDemoWindow() START") - - Config.Title = "Demo andlabs/ui Toolkit" - Config.Width = 640 - Config.Height = 480 - Config.Exit = StandardClose - w = NewWindow() - - w.DemoAndlabsUiTab("ran AddDemoAndlabsUiTab()") - - log.Println("ToolkitDemoWindow() END") -} - -// This will create a tab in a window using direct -// calls to andlabs/ui. This can be used to bypass -// the obvuscation added in this package if it is desired -// or needed. -func (n *Node) DemoAndlabsUiTab(title string) { - newNode := n.AddTab(title, makeAndlabsUiTab()) - if (Config.DebugNode) { - newNode.Dump() - } - tabSetMargined(newNode.uiTab) -} - -func makeAndlabsUiTab() *ui.Box { - hbox := ui.NewHorizontalBox() - hbox.SetPadded(true) - - group := ui.NewGroup("Numbers") - group.SetMargined(true) - hbox.Append(group, true) - - vbox := ui.NewVerticalBox() - vbox.SetPadded(true) - group.SetChild(vbox) - - spinbox := ui.NewSpinbox(47, 100) - slider := ui.NewSlider(21, 100) - pbar := ui.NewProgressBar() - - spinbox.OnChanged(func(*ui.Spinbox) { - slider.SetValue(spinbox.Value()) - pbar.SetValue(spinbox.Value()) - }) - slider.OnChanged(func(*ui.Slider) { - spinbox.SetValue(slider.Value()) - pbar.SetValue(slider.Value()) - }) - vbox.Append(spinbox, false) - vbox.Append(slider, false) - vbox.Append(pbar, false) - - ip := ui.NewProgressBar() - ip.SetValue(-1) - vbox.Append(ip, false) - - group = ui.NewGroup("Lists") - group.SetMargined(true) - hbox.Append(group, true) - - vbox = ui.NewVerticalBox() - vbox.SetPadded(true) - group.SetChild(vbox) - - cbox := ui.NewCombobox() - cbox.Append("Combobox Item 1") - cbox.Append("Combobox Item 2") - cbox.Append("Combobox Item 3") - vbox.Append(cbox, false) - - ecbox := ui.NewEditableCombobox() - ecbox.Append("Editable Item 1") - ecbox.Append("Editable Item 2") - ecbox.Append("Editable Item 3") - vbox.Append(ecbox, false) - - ecbox.OnChanged(func(*ui.EditableCombobox) { - log.Println("test") - test := ecbox.Text() - log.Println("test=", test) - }) - - rb := ui.NewRadioButtons() - rb.Append("Radio Button 1") - rb.Append("Radio Button 2") - rb.Append("Radio Button 3") - vbox.Append(rb, false) - - return hbox -} diff --git a/window.go b/window.go index 75097ee..db1ede4 100644 --- a/window.go +++ b/window.go @@ -195,6 +195,7 @@ func NewWindow() *Node { title := Config.Title w := Config.Width h := Config.Height + f := Config.Exit var n *Node n = mapWindow(nil, nil, title, w, h) @@ -204,7 +205,6 @@ func NewWindow() *Node { n.uiNewWindow(box.Name, w, h) window := n.uiWindow - f := Config.Exit ui.OnShouldQuit(func() bool { log.Println("createWindow().Destroy() on node.Name =", n.Name) if (f != nil) {