attempt to embedded gocui plugin toolkit

This commit is contained in:
Jeff Carr 2025-01-20 05:08:52 -06:00
parent ef1a306352
commit 4721184398
4 changed files with 42 additions and 1 deletions

View File

@ -14,10 +14,14 @@ verbose:
GO111MODULE=off go build -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: goimports vet
install: goimports vet plugin
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
plugin:
rm -f resources/*.so
cp ~/go/lib/gocui.so resources/
goimports:
reset
goimports -w *.go

View File

@ -26,7 +26,13 @@ func debug() {
}
func doGui() {
if me.forge.Config.GetDefaultGui() == "" {
me.forge.Config.DefaultGui = "gocui"
me.forge.ConfigSave()
}
me.myGui = gui.New()
me.myGui.InitEmbed(resources)
me.myGui.SetAppDefaultPlugin(me.forge.Config.DefaultGui) // sets the default GUI plugin to use
me.myGui.Default()
// debug()

View File

@ -3,6 +3,7 @@ package main
// An app to submit patches for the 30 GO GUI repos
import (
"embed"
"os"
"strings"
@ -17,6 +18,11 @@ import (
var VERSION string
var BUILDTIME string
// this optionally can store the GUI plugins
//
//go:embed resources/*
var resources embed.FS
// used for shell auto completion
var ARGNAME string = "forge"

25
resources/forge.text Normal file
View File

@ -0,0 +1,25 @@
# this file is automatically re-generated from forge.pb, however,
# if you want to edit it by hand, you can:
# stop forge; remove forge.pb; edit forge.text; start forge
# this will cause the default behavior to fallback to parsing this file for the config
# this file is intended to be used to customize settings on what
# git repos you have write access to. That is, where you can run 'git push'
ForgeConfigs: {
goPath: "go.wit.com"
writable: true
directory: true
}
repos: {
goPath: "go.wit.com/apps/zookeeper"
debName: "zookeeper-go"
}
xterm: "xterm"
xtermArgv: "-bg"
xtermArgv: "black"
xtermArgv: "-fg"
xtermArgv: "white"
xtermArgv: "-geometry"
xtermArgv: "140x32"
xtermArgv: "-e"