From b410d0fd083ee89eed410cda2123a22cddcd3f44 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 6 Nov 2022 19:57:20 -0600 Subject: Implement a early AddButton() via a golang plugin pass a name to gocui.AddButton() cleaner plugin usage add the start to golang plugin plugin stuff in a single file added a button correctly andlabs/ui added a button via plugin to gocli hot diggity! trying to invoke a gocli plugin function from the andlabs ui load the plugin hide more debugging output turn off all output Signed-off-by: Jeff Carr --- toolkit/andlabs/box.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'toolkit/andlabs/box.go') diff --git a/toolkit/andlabs/box.go b/toolkit/andlabs/box.go index 8347bab..29a8331 100644 --- a/toolkit/andlabs/box.go +++ b/toolkit/andlabs/box.go @@ -12,10 +12,14 @@ func (t *Toolkit) GetBox() *ui.Box { // create a new box func (t *Toolkit) NewBox() *Toolkit { - log.Println("gui.Toolbox.NewBox() START create default") + if (DebugToolkit) { + log.Println("gui.Toolbox.NewBox() START create default") + } t.Dump() if (t.uiGroup != nil) { - log.Println("\tgui.Toolbox.NewBox() is a Group") + if (DebugToolkit) { + log.Println("\tgui.Toolbox.NewBox() is a Group") + } var newTK Toolkit vbox := ui.NewVerticalBox() @@ -26,7 +30,9 @@ func (t *Toolkit) NewBox() *Toolkit { return &newTK } if (t.uiBox != nil) { - log.Println("\tgui.Toolbox.NewBox() is a Box") + if (DebugToolkit) { + log.Println("\tgui.Toolbox.NewBox() is a Box") + } var newTK Toolkit vbox := ui.NewVerticalBox() @@ -38,7 +44,9 @@ func (t *Toolkit) NewBox() *Toolkit { return &newTK } if (t.uiWindow != nil) { - log.Println("\tgui.Toolbox.NewBox() is a Window") + if (DebugToolkit) { + log.Println("\tgui.Toolbox.NewBox() is a Window") + } var newT Toolkit vbox := ui.NewVerticalBox() @@ -50,7 +58,9 @@ func (t *Toolkit) NewBox() *Toolkit { // panic("WTF") return &newT } - log.Println("\tgui.Toolbox.NewBox() FAILED. Couldn't figure out where to make a box") + if (DebugToolkit) { + log.Println("\tgui.Toolbox.NewBox() FAILED. Couldn't figure out where to make a box") + } t.Dump() return nil } -- cgit v1.2.3