From e55fb6675d692e3f44fa67b02b12661e476bd028 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 6 Nov 2022 12:59:24 -0600 Subject: start trying to make the tookits plugins totally minimize helloworld demo try to make a button plugin example debug changes final changes before attempting to use a golang plugin actually running gocui as a plugin add gocli-as-plugin example try to convert the go-cui toolkit into a plugin doc updates make a minimal console gui Signed-off-by: Jeff Carr --- toolkit/andlabs/common.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'toolkit/andlabs/common.go') diff --git a/toolkit/andlabs/common.go b/toolkit/andlabs/common.go index 569621d..e997aca 100644 --- a/toolkit/andlabs/common.go +++ b/toolkit/andlabs/common.go @@ -2,9 +2,6 @@ package toolkit import "log" -// import "github.com/andlabs/ui" -// import _ "github.com/andlabs/ui/winmanifest" - func init() { log.Println("gui/toolkit init() Setting defaultBehavior = true") setDefaultBehavior(true) @@ -37,8 +34,13 @@ func (t Toolkit) commonChange(widget string) { // does some sanity checks on the internal structs of the binary tree // TODO: probably this should not panic unless it's running in devel mode (?) -func (t Toolkit) broken() bool { +func (t *Toolkit) broken() bool { if (t.uiBox == nil) { + if (t.uiWindow != nil) { + log.Println("gui.Toolkit.UiBox == nil. This is an empty window. Try to add a box") + t.NewBox() + return false + } log.Println("gui.Toolkit.UiBox == nil. I can't add a widget without a place to put it") // log.Println("probably could just make a box here?") // corruption or something horrible? @@ -48,6 +50,7 @@ func (t Toolkit) broken() bool { } if (t.uiWindow == nil) { log.Println("gui.Toolkit.UiWindow == nil. I can't add a widget without a place to put it (IGNORING FOR NOW)") + forceDump(t) return false } return false -- cgit v1.2.3