diff options
| author | Jeff Carr <[email protected]> | 2024-01-11 20:37:39 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-11 20:37:39 -0600 |
| commit | 5351099972a0fab777a7ac17a3caccccd0ae562f (patch) | |
| tree | 5f3ef6cd7827cf1e87f10b53df84d74708434306 /basicWindow.go | |
| parent | b6d0521996572f0eebd6ff039e80a29fcaeb853b (diff) | |
gui api updatesv0.10.3
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'basicWindow.go')
| -rw-r--r-- | basicWindow.go | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/basicWindow.go b/basicWindow.go index 6385a5e..d866d8e 100644 --- a/basicWindow.go +++ b/basicWindow.go @@ -12,7 +12,7 @@ type BasicWindow struct { ready bool hidden bool vertical bool - name string + title string parent *gui.Node win *gui.Node // window widget @@ -76,32 +76,32 @@ func (w *BasicWindow) Box() *gui.Node { } func (w *BasicWindow) Vertical() { - log.Log(INFO, "BasicWindow() w.vertical =", w.vertical) - if ! w.Initialized() { - log.Warn("BasicWindow() not Initialized yet()") - return - } - if w.Ready() { - log.Warn("BasicWindow() is already created. You can not change it to Vertical now (TODO: fix this)") - return - } + log.Warn("BasicWindow() Vertical() START w.vertical =", w.vertical, w.title) + if w == nil {return} w.vertical = true - log.Log(INFO, "BasicWindow() w.vertical =", w.vertical) + log.Warn("BasicWindow() Vertical() END w.vertical =", w.vertical, w.title) +} + +func (w *BasicWindow) Horizontal() { + log.Warn("BasicWindow() Horizontal() START w.vertical =", w.vertical, w.title) + if w == nil {return} + w.vertical = false + log.Warn("BasicWindow() Horizontal() END w.vertical =", w.vertical, w.title) } func (w *BasicWindow) Make() { if ! w.Initialized() {return} // various timeout settings - w.win = w.parent.RawWindow(w.name) + w.win = w.parent.RawWindow(w.title) w.win.Custom = func() { - log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.name) + log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.title) } if w.vertical { - w.box = w.win.NewBox("bw vbox", false) - log.Log(INFO, "BasicWindow.Custom() made vbox") + w.box = w.win.NewVerticalBox("BW VBOX") + log.Log(INFO, "BasicWindow.Make() made NewVerticalBox", w.title) } else { - w.box = w.win.NewBox("bw hbox", true) - log.Log(INFO, "BasicWindow.Custom() made hbox") + w.box = w.win.NewHorizontalBox("BW HBOX") + log.Log(INFO, "BasicWindow.Make() made NewHorizontalBox", w.title) } w.ready = true @@ -110,29 +110,31 @@ func (w *BasicWindow) Make() { func (w *BasicWindow) Draw() { if ! w.Initialized() {return} // various timeout settings - w.win = w.parent.NewWindow(w.name) + w.win = w.parent.NewWindow(w.title) w.win.Custom = func() { - log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.name) + log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.title) } + log.Warn("BasicWindow.Draw() about to make a box vertical =", w.vertical, w.title) if w.vertical { - w.box = w.win.NewBox("bw vbox", false) - log.Log(INFO, "BasicWindow.Custom() made vbox") + w.box = w.win.NewVerticalBox("BW VBOX") + log.Log(INFO, "BasicWindow.Draw() made vbox title =", w.title) } else { - w.box = w.win.NewBox("bw hbox", true) - log.Log(INFO, "BasicWindow.Custom() made hbox") + w.box = w.win.NewHorizontalBox("BW HBOX") + log.Log(INFO, "BasicWindow.Draw() made hbox title =", w.title) } w.ready = true } -func NewBasicWindow(parent *gui.Node, name string) *BasicWindow { +func NewBasicWindow(parent *gui.Node, title string) *BasicWindow { var w *BasicWindow w = &BasicWindow { parent: parent, - name: name, + title: title, vertical: false, } + log.Warn("NewBasicWindow() END") return w } |
