GUI: add a example for wit/gui

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-09-01 21:05:06 -05:00
parent 77659fd593
commit 3a28ded3e8
7 changed files with 37 additions and 4 deletions

View File

@ -26,6 +26,9 @@ build:
cd example-ui-table; go install # spreadsheet
cd example-ui-show-hide; go install # toggle hide, show
# wit/gui things
cd example-gui; go install # an example using the wit/gui wrapper
# misc
cd example-lookupAAAA; go install # nslookup
cd example-json-decode; go install # raw golang byte handling
@ -34,8 +37,9 @@ build:
# golang things
cd example-flag; go install # process argv
cd example-pprof; go install # dump out go process internals
cd example-protobuf; go install # convert json into golang protobuf struct
cd example-bench-fast-timer; go install # time golang channels
cd example-bench-readWriteOps; go install #
cd example-bench-readWriteOps; go install # uses channels to time select
# witgoget='-v -t' make prep
# witgoget='-v -t -u' make prep # to update

View File

@ -65,10 +65,11 @@ func main() {
gui.StartNewWindow(false, "test5", 2, showBox)
}
func showBox(gw *gui.GuiWindow) *gui.GuiBox {
// func showBox(gw *gui.GuiWindow) *gui.GuiBox {
func showBox(gw *gui.GuiBox) *gui.GuiBox {
log.Println("ShowSplashBox() START")
box := gui.HardBox(gw, gui.Yaxis, "Cloud Accounts")
box := gui.HardBox(gw.Window, gui.Yaxis, "Cloud Accounts")
log.Println("showBox() START GW IS NOW: gw =", gw)
log.Println("showBox() box =", box)

View File

@ -0,0 +1,28 @@
{
"width": 800,
"height": 600,
"accounts": [
{
"ID": 42,
"nick": "Alpha jcarr",
"username": "jcarr@wit.com",
"email": "jcarr@wit.com",
"token": "alksjdf",
"hostname": "jcarr.customers.wprod.wit.com",
"password": "witbadpass",
"URL": "http://stackapi-api1.stackapi.customers.wprod.wit.com:4000/",
"domain": "jcarr.customers.wprod.wit.com"
},
{
"ID": 44,
"nick": "Alpha alfonso",
"username": "alfonso@wit.com",
"email": "alfonso@wit.com",
"token": "aklsdjf",
"hostname": "alfonso.customers.wprod.wit.com",
"password": "witbadpass",
"URL": "http://stackapi-api1.stackapi.customers.wprod.wit.com:4000/",
"domain": "alfonso.customers.wprod.wit.com"
}
]
}

View File

@ -25,7 +25,7 @@ import "github.com/davecgh/go-spew/spew"
func loadDefaultConfig(a string) pb.Config {
sets := pb.Config{}
b, err := ioutil.ReadFile("../resources/cloud-control-panel.json")
b, err := ioutil.ReadFile("cloud-control-panel.json")
if err != nil {
log.Println("ioutil.ReadFile() ERROR =", err)
}