BOX: remove GuiBox

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-10-31 19:52:18 -05:00
parent b90d7b96c3
commit e74b054beb
3 changed files with 10 additions and 3 deletions

6
box.go
View File

@ -1,7 +1,7 @@
package gui package gui
import "log" import "log"
import "os" // import "os"
// import "reflect" // import "reflect"
import "github.com/andlabs/ui" import "github.com/andlabs/ui"
@ -102,12 +102,13 @@ func (n *Node) AddBox(axis int, name string) *Node {
return newNode return newNode
} }
/*
func (b *GuiBox) NewBox(axis int, name string) *GuiBox { func (b *GuiBox) NewBox(axis int, name string) *GuiBox {
log.Println("gui.NewBox() START") log.Println("gui.NewBox() START")
n := b.FindNode() n := b.FindNode()
if (n == nil) { if (n == nil) {
log.Println("gui.NewBox() SERIOUS ERROR. CAN NOT FIND NODE") log.Println("gui.NewBox() SERIOUS ERROR. CAN NOT FIND NODE")
os.Exit(0) panic("gui.NewBox() SERIOUS ERROR. CAN NOT FIND NODE")
} else { } else {
log.Println("gui.NewBox() node =", n.Name) log.Println("gui.NewBox() node =", n.Name)
} }
@ -128,6 +129,7 @@ func (b *GuiBox) NewBox(axis int, name string) *GuiBox {
// panic("gui.NewBox") // panic("gui.NewBox")
return newbox return newbox
} }
*/
func HardBox(gw *GuiWindow, axis int, name string) *GuiBox { func HardBox(gw *GuiWindow, axis int, name string) *GuiBox {
log.Println("HardBox() START axis =", axis) log.Println("HardBox() START axis =", axis)

View File

@ -17,6 +17,7 @@ func (n *Node) FindControl() *ui.Control {
return n.uiControl return n.uiControl
} }
/*
func (n *Node) FindBox() *GuiBox { func (n *Node) FindBox() *GuiBox {
if (n.box != nil) { if (n.box != nil) {
return n.box return n.box
@ -34,11 +35,13 @@ func (n *Node) FindWindowBox() *GuiBox {
} }
return n.box return n.box
} }
*/
func (w *GuiWindow) FindNode() *Node { func (w *GuiWindow) FindNode() *Node {
return w.node return w.node
} }
/*
func (b *GuiBox) FindNode() *Node { func (b *GuiBox) FindNode() *Node {
log.Println("gui.FindNode() on GuiBox") log.Println("gui.FindNode() on GuiBox")
if b.node != nil { if b.node != nil {
@ -50,6 +53,7 @@ func (b *GuiBox) FindNode() *Node {
os.Exit(-1) os.Exit(-1)
return nil return nil
} }
*/
func FindWindow(s string) *GuiWindow { func FindWindow(s string) *GuiWindow {
for name, window := range Data.WindowMap { for name, window := range Data.WindowMap {

View File

@ -97,10 +97,11 @@ func (n *Node) Dump() {
} }
} }
/*
func (n *Node) SetBox(box *GuiBox) { func (n *Node) SetBox(box *GuiBox) {
n.box = box n.box = box
} }
*/
func (n *Node) SetName(name string) { func (n *Node) SetName(name string) {
// n.uiType.SetName(name) // n.uiType.SetName(name)