summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-14 10:25:23 -0600
committerJeff Carr <[email protected]>2024-01-14 10:25:23 -0600
commitd9115cc29adeac39159587bf72b16e9349154997 (patch)
treed6d7949b0dc55300f3cf6f7e99298544f3f6f9bc
parent9d468879c70f037377e8d901d251fedc0e3c84fd (diff)
compiles and runsv0.12.2
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--basicWindow.go55
1 files changed, 20 insertions, 35 deletions
diff --git a/basicWindow.go b/basicWindow.go
index d4a9766..aa8713b 100644
--- a/basicWindow.go
+++ b/basicWindow.go
@@ -21,11 +21,16 @@ type BasicWindow struct {
Custom func()
}
-func (w *BasicWindow) Hide() {
- if ! w.Ready() {return}
- w.win.Hide()
- w.hidden = true
- return
+func NewBasicWindow(parent *gui.Node, title string) *BasicWindow {
+ var w *BasicWindow
+ w = &BasicWindow {
+ parent: parent,
+ title: title,
+ vertical: false,
+ }
+ log.Warn("NewBasicWindow() END")
+
+ return w
}
func (w *BasicWindow) Show() {
@@ -35,6 +40,13 @@ func (w *BasicWindow) Show() {
return
}
+func (w *BasicWindow) Hide() {
+ if ! w.Ready() {return}
+ w.win.Hide()
+ w.hidden = true
+ return
+}
+
func (w *BasicWindow) Toggle() {
if ! w.Ready() {return}
if w.hidden {
@@ -115,7 +127,7 @@ func (w *BasicWindow) TestDraw() {
if ! w.Initialized() {return}
if w.win == nil {
log.Warn("BasicWindow.TestDraw() can't draw on window == nil")
- return
+ w.Make()
}
log.Warn("BasicWindow.TestDraw() RUNNING HERE")
w.win.TestDraw()
@@ -125,34 +137,7 @@ func (w *BasicWindow) Draw() {
if ! w.Initialized() {return}
if w.win != nil {
log.Warn("BasicWindow.Draw() window was already created")
- return
+ w.Make()
}
- // various timeout settings
- w.win = w.parent.NewWindow(w.title)
- w.win.Custom = func() {
- 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.NewVerticalBox("BW VBOX")
- log.Log(INFO, "BasicWindow.Draw() made vbox title =", w.title)
- } else {
- 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, title string) *BasicWindow {
- var w *BasicWindow
- w = &BasicWindow {
- parent: parent,
- title: title,
- vertical: false,
- }
- log.Warn("NewBasicWindow() END")
-
- return w
+ w.win.TestDraw()
}