From 8730dbc4dd5e36d5fbbc8ce784e1ad70242cbb69 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 24 May 2019 11:32:47 -0700 Subject: move all structs into a common file Signed-off-by: Jeff Carr --- debug.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'debug.go') diff --git a/debug.go b/debug.go index 7f7571b..82e64af 100644 --- a/debug.go +++ b/debug.go @@ -5,6 +5,7 @@ import "time" import "fmt" import "strings" import "os/exec" +import "runtime" import "github.com/gookit/config" @@ -17,7 +18,7 @@ import _ "github.com/andlabs/ui/winmanifest" // can not pass any args to this (?) func setupCloudUI() { - Data.cloudWindow = ui.NewWindow("Cloud Control Panel", config.Int("width"), config.Int("height"), false) + Data.cloudWindow = ui.NewWindow("Cloud Control Panel", Data.Width, config.Int("height"), false) Data.cloudWindow.OnClosing(func(*ui.Window) bool { ui.Quit() return true @@ -112,11 +113,18 @@ func addDebuggingButtons(vbox *ui.Box, custom func(*ButtonMap, string)) { vbox.Append(CreateButton("DEBUG goroutines", "DEBUG", custom), false) vbox.Append(CreateButton("xterm", "XTERM", runTestExecClick), false) + vbox.Append(CreateButton("Load test.json config file", "CONFIG", custom), false) } func runTestExecClick(b *ButtonMap, msg string) { log.Println("runTestExecClick START") - go runCommand("xterm -report-fonts") + if runtime.GOOS == "linux" { + go runCommand("xterm -report-fonts") + } else if runtime.GOOS == "windows" { + go runCommand("cmd.exe") + } else { + go runCommand("xterm") + } log.Println("runTestExecClick END") } -- cgit v1.2.3