From 686c7f0bd6a69580e2c1503c89cc21c1881d368a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 13 Oct 2025 12:43:51 -0500 Subject: new funcs for gui --- argv.go | 6 ++++++ main.go | 1 - structs.go | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/argv.go b/argv.go index 96fdccf..e5b8e28 100644 --- a/argv.go +++ b/argv.go @@ -3,6 +3,7 @@ package main import ( "os" + "go.wit.com/lib/fhelp" "go.wit.com/lib/gui/prep" "go.wit.com/log" ) @@ -92,6 +93,11 @@ func (args) Buildtime() (string, string) { return BUILDTIME, VERSION } +func (args) ArgvGui() error { + me.myGui = fhelp.Gui() // adds the GUI package argv support + return nil +} + func (a args) DoAutoComplete(pb *prep.Auto) { if pb.Cmd == "" { pb.Autocomplete3([]string{"--version", "list", "droplet"}) diff --git a/main.go b/main.go index 19e27b8..5975d77 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,6 @@ var resources embed.FS func main() { me = new(virtigoT) - me.myGui = prep.Gui() // prepares the GUI package for go-args me.auto = prep.Bash3(&argv) // add support for bash autocomplete with go-arg if os.Getenv("VIRTIGO_HOME") == "" { diff --git a/structs.go b/structs.go index 056d240..c156ad9 100644 --- a/structs.go +++ b/structs.go @@ -5,6 +5,7 @@ import ( "time" "go.wit.com/gui" + "go.wit.com/lib/fhelp" "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/prep" "go.wit.com/lib/protobuf/virtpb" @@ -25,7 +26,7 @@ func (b *virtigoT) Enable() { // this app's variables type virtigoT struct { auto *prep.Auto // more experiments for bash handling - myGui *prep.GuiPrep // the gui toolkit handle + myGui *fhelp.GuiPrep // the gui toolkit handle e *virtpb.Events // virt protobuf events hmap map[*virtpb.Hypervisor]*HyperT // map to the local struct names []string // ? -- cgit v1.2.3