debug embed handling
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
0450de636f
commit
c780a62521
|
@ -3,3 +3,4 @@ wit-new-machine
|
||||||
/files/*
|
/files/*
|
||||||
/*.deb
|
/*.deb
|
||||||
/resources/toolkits/
|
/resources/toolkits/
|
||||||
|
/plugins/
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -7,8 +7,7 @@ VERSION = $(shell cat resources/VERSION)
|
||||||
|
|
||||||
build:
|
build:
|
||||||
git pull
|
git pull
|
||||||
# reset
|
-cp ~/go/src/git.wit.org/wit/gui/toolkit/*.so plugins/
|
||||||
-cp ~/go/src/git.wit.org/wit/gui/toolkit/*.so resources/toolkits/
|
|
||||||
GO111MODULE="off" go build -v
|
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
|
||||||
|
|
||||||
|
|
9
main.go
9
main.go
|
@ -20,10 +20,11 @@ var username string
|
||||||
var hostname string
|
var hostname string
|
||||||
var geom string = "120x30+500+500"
|
var geom string = "120x30+500+500"
|
||||||
|
|
||||||
|
|
||||||
//go:embed resources
|
//go:embed resources
|
||||||
var res embed.FS
|
var res embed.FS
|
||||||
|
|
||||||
//go:embed resources/toolkits
|
//go:embed plugins/*.so
|
||||||
var resToolkit embed.FS
|
var resToolkit embed.FS
|
||||||
|
|
||||||
//go:embed resources/ttyS0.conf
|
//go:embed resources/ttyS0.conf
|
||||||
|
@ -54,10 +55,14 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.GuiToolkit == nil) {
|
if (args.GuiToolkit == nil) {
|
||||||
myGui = gui.New().InitEmbed(resToolkit).Default()
|
myGui = gui.New().Default()
|
||||||
|
} else {
|
||||||
|
if args.GuiToolkit[0] == "gocui" {
|
||||||
|
myGui = gui.New().LoadToolkit(args.GuiToolkit[0])
|
||||||
} else {
|
} else {
|
||||||
myGui = gui.New().InitEmbed(resToolkit).LoadToolkit(args.GuiToolkit[0])
|
myGui = gui.New().InitEmbed(resToolkit).LoadToolkit(args.GuiToolkit[0])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
drawWindow()
|
drawWindow()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue