CLEAN: rename some functions for consistancy

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-10-28 19:11:37 -05:00
parent e5763fa317
commit 8a87d0cb59
3 changed files with 6 additions and 27 deletions

View File

@ -34,7 +34,7 @@ func initGUI() {
gui.Config.Height = 240 gui.Config.Height = 240
gui.Config.Exit = myExit gui.Config.Exit = myExit
node2 := gui.NewWindow() node2 := gui.NewWindow()
node2.AddDemoAndlabsUiTab("A Simple andlabs/ui Tab Demo") node2.DemoAndlabsUiTab("A Simple andlabs/ui Tab Demo")
} }
// This demonstrates how to properly interact with the GUI // This demonstrates how to properly interact with the GUI

View File

@ -16,7 +16,7 @@ var nodeNames = make([]string, 100)
func DebugWindow() { func DebugWindow() {
Config.Title = "DebugWindow()" Config.Title = "DebugWindow()"
node := NewWindow() node := NewWindow()
node.AddDebugTab("WIT GUI Debug Tab") node.DebugTab("WIT GUI Debug Tab")
} }
// TODO: remove this crap // TODO: remove this crap
@ -236,23 +236,10 @@ func makeWindowDebug() *ui.Box {
log.Println("nodeNames[y] =", nodeNames[y]) log.Println("nodeNames[y] =", nodeNames[y])
node := Data.findId(nodeNames[y]) node := Data.findId(nodeNames[y])
if (node != nil) { if (node != nil) {
node.AddDebugTab("added this DebugTab") node.DebugTab("added this DebugTab")
} }
}) })
/*
n1 = addButton(vbox, "Node.DemoTab")
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.AddDemoTab("ran gui.AddDemoTab() " + strconv.Itoa(Config.counter))
}
})
*/
n1 = addButton(vbox, "Node.DemoAndlabsUiTab") n1 = addButton(vbox, "Node.DemoAndlabsUiTab")
n1.OnClicked(func(*ui.Button) { n1.OnClicked(func(*ui.Button) {
y := nodeCombo.Selected() y := nodeCombo.Selected()
@ -260,18 +247,10 @@ func makeWindowDebug() *ui.Box {
log.Println("nodeNames[y] =", nodeNames[y]) log.Println("nodeNames[y] =", nodeNames[y])
node := Data.findId(nodeNames[y]) node := Data.findId(nodeNames[y])
if (node != nil) { if (node != nil) {
node.AddDemoAndlabsUiTab("ran gui.AddDemoAndlabsUiTab() " + strconv.Itoa(Config.counter)) node.DemoAndlabsUiTab("ran gui.AddDemoAndlabsUiTab() " + strconv.Itoa(Config.counter))
} }
}) })
/*
/////////////////////////////////////////////////////
vbox = addGroup(hbox, "Numbers")
pbar := ui.NewProgressBar()
vbox.Append(pbar, false)
*/
return hbox return hbox
} }
@ -351,7 +330,7 @@ func addButton(box *ui.Box, name string) *ui.Button {
return button return button
} }
func (n *Node) AddDebugTab(title string) { func (n *Node) DebugTab(title string) {
newNode := n.AddTab(title, makeWindowDebug()) newNode := n.AddTab(title, makeWindowDebug())
if (Config.DebugNode) { if (Config.DebugNode) {
newNode.Dump() newNode.Dump()

View File

@ -8,7 +8,7 @@ import _ "github.com/andlabs/ui/winmanifest"
// calls to andlabs/ui. This can be used to bypass // calls to andlabs/ui. This can be used to bypass
// the obvuscation added in this package if it is desired // the obvuscation added in this package if it is desired
// or needed. // or needed.
func (n *Node) AddDemoAndlabsUiTab(title string) { func (n *Node) DemoAndlabsUiTab(title string) {
newNode := n.AddTab(title, makeAndlabsUiTab()) newNode := n.AddTab(title, makeAndlabsUiTab())
if (Config.DebugNode) { if (Config.DebugNode) {
newNode.Dump() newNode.Dump()