debug embed handling

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-28 08:14:10 -05:00
parent 0450de636f
commit c780a62521
3 changed files with 11 additions and 6 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ wit-new-machine
/files/*
/*.deb
/resources/toolkits/
/plugins/

View File

@ -7,10 +7,9 @@ VERSION = $(shell cat resources/VERSION)
build:
git pull
# reset
-cp ~/go/src/git.wit.org/wit/gui/toolkit/*.so resources/toolkits/
-cp ~/go/src/git.wit.org/wit/gui/toolkit/*.so plugins/
GO111MODULE="off" go build -v
./wit-new-machine --gui-toolkit gocui >/tmp/witgui.log.stderr 2>&1
./wit-new-machine --gui-toolkit gocui >/tmp/witgui.log.stderr 2>&1
nocui:
./wit-new-machine --gui-toolkit nocui

11
main.go
View File

@ -20,10 +20,11 @@ var username string
var hostname string
var geom string = "120x30+500+500"
//go:embed resources
var res embed.FS
//go:embed resources/toolkits
//go:embed plugins/*.so
var resToolkit embed.FS
//go:embed resources/ttyS0.conf
@ -54,9 +55,13 @@ func main() {
}
if (args.GuiToolkit == nil) {
myGui = gui.New().InitEmbed(resToolkit).Default()
myGui = gui.New().Default()
} else {
myGui = gui.New().InitEmbed(resToolkit).LoadToolkit(args.GuiToolkit[0])
if args.GuiToolkit[0] == "gocui" {
myGui = gui.New().LoadToolkit(args.GuiToolkit[0])
} else {
myGui = gui.New().InitEmbed(resToolkit).LoadToolkit(args.GuiToolkit[0])
}
}
drawWindow()