From 4ed50c9747e76797985952f36a1273300b2ae302 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 6 Jan 2024 13:54:06 -0600 Subject: [PATCH] support Make()/Draw() state Signed-off-by: Jeff Carr --- basicWindow.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/basicWindow.go b/basicWindow.go index 2f34513..6385a5e 100644 --- a/basicWindow.go +++ b/basicWindow.go @@ -89,6 +89,24 @@ func (w *BasicWindow) Vertical() { log.Log(INFO, "BasicWindow() w.vertical =", w.vertical) } +func (w *BasicWindow) Make() { + if ! w.Initialized() {return} + // various timeout settings + w.win = w.parent.RawWindow(w.name) + w.win.Custom = func() { + log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.name) + } + if w.vertical { + w.box = w.win.NewBox("bw vbox", false) + log.Log(INFO, "BasicWindow.Custom() made vbox") + } else { + w.box = w.win.NewBox("bw hbox", true) + log.Log(INFO, "BasicWindow.Custom() made hbox") + } + + w.ready = true +} + func (w *BasicWindow) Draw() { if ! w.Initialized() {return} // various timeout settings