diff --git a/basicEntry.go b/basicEntry.go index e65fde3..6dab1dc 100644 --- a/basicEntry.go +++ b/basicEntry.go @@ -70,7 +70,7 @@ func NewBasicEntry(p *gui.Node, name string) *BasicEntry { d.l = p.NewLabel(name) d.v = p.NewEntryLine("") d.v.Custom = func() { - d.value = d.v.S + d.value = d.v.GetText() log.Log(INFO, "BasicEntry.Custom() user changed value to =", d.value) if d.Custom != nil { d.Custom() diff --git a/basicLabel.go b/basicLabel.go index 6d87087..fc410d3 100644 --- a/basicLabel.go +++ b/basicLabel.go @@ -52,7 +52,7 @@ func (ngui *Node) NewBasicLabel(name string) *BasicLabel { d.l = n.NewLabel(name) d.v = n.NewLabel("") d.v.Custom = func() { - d.value = d.v.S + d.value = d.v.GetText() log.Log(INFO, "BasicLabel.Custom() user changed value to =", d.value) } 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 } diff --git a/durationSlider.go b/durationSlider.go index 97aeb53..819fe50 100644 --- a/durationSlider.go +++ b/durationSlider.go @@ -49,7 +49,7 @@ func (n *Duration) Set(d time.Duration) { offset = d - n.Low i := int(offset / step) log.Log(INFO, "duration.Set() =", n.Low, n.High, d, "i =", i) - n.s.I = i + // n.s.I = i n.s.Set(i) n.s.Custom() } @@ -66,7 +66,7 @@ func NewDurationSlider(n *gui.Node, label string, low time.Duration, high time.D d.l = n.NewLabel(label) d.s = n.NewSlider(label, 0, 1000) d.s.Custom = func () { - d.Duration = low + (high - low) * time.Duration(d.s.I) / 1000 + d.Duration = low + (high - low) * time.Duration(d.s.GetInt()) / 1000 log.Println("d.Duration =", d.Duration) s := fmt.Sprintf("%s (%v)", d.Label, d.Duration) d.l.SetText(s) diff --git a/logFlag.go b/logFlag.go index 84342e2..80453c3 100644 --- a/logFlag.go +++ b/logFlag.go @@ -55,7 +55,7 @@ func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag { // various timeout settings f.c = n.NewCheckbox(f.Name + ": " + f.Desc) f.c.Custom = func() { - f.lf.Set(f.c.B) + f.lf.Set(f.c.GetBool()) log.Info("LogFlag.Custom() user changed value to =", f.lf.Get()) } f.c.Set(lf.Get()) diff --git a/oneLiner.go b/oneLiner.go index 5661d75..b75842a 100644 --- a/oneLiner.go +++ b/oneLiner.go @@ -70,7 +70,7 @@ func NewOneLiner(n *gui.Node, name string) *OneLiner { d.l = n.NewLabel(name) d.v = n.NewLabel("") d.v.Custom = func() { - d.value = d.v.S + d.value = d.v.GetText() log.Log(INFO, "OneLiner.Custom() user changed value to =", d.value) }