diff --git a/src/modules/draw/define.go b/src/modules/draw/define.go index a9030cb..815fafb 100644 --- a/src/modules/draw/define.go +++ b/src/modules/draw/define.go @@ -5,4 +5,5 @@ import "fyne.io/fyne/v2" var ( entrySize fyne.Size = fyne.NewSize(300, 50) buttonSize fyne.Size = fyne.NewSize(250, 50) + windowSize fyne.Size = fyne.NewSize(1280, 720) ) diff --git a/src/modules/draw/draw.go b/src/modules/draw/draw.go index 0c384ea..65c7f9a 100644 --- a/src/modules/draw/draw.go +++ b/src/modules/draw/draw.go @@ -53,6 +53,26 @@ func MakeInput(targEntry *widget.Entry, book *string) *fyne.Container { } func MakeFooter(targEntry *widget.Entry, book *string, app fyne.App) *fyne.Container { + var result string + + showBtn := widget.NewButton("Show Results", func() { + log.Println("showing output") + + w := app.NewWindow("Result Display") + w.Resize(windowSize) + + textEntry := widget.NewMultiLineEntry() + textEntry.SetText(result) + + w.SetContent(container.NewScroll(textEntry)) + w.Show() + }) + showWrap := container.NewGridWrap( + buttonSize, + showBtn, + ) + showBtn.Disable() + actionBtn := widget.NewButton("Execute", func() { log.Println("beginning execution with external binary") @@ -60,11 +80,11 @@ func MakeFooter(targEntry *widget.Entry, book *string, app fyne.App) *fyne.Conta if !ok { log.Println("something went wrong while looking for the binary, see above for details") } - ok, result := runner.RunMeshbook(path, *book, targEntry.Text) + ok, result = runner.RunMeshbook(path, *book, targEntry.Text) if !ok { log.Println("something went wrong while running the meshbook, see above for details") } - log.Println(result) + showBtn.Enable() }) actionWrap := container.NewGridWrap( @@ -82,7 +102,8 @@ func MakeFooter(targEntry *widget.Entry, book *string, app fyne.App) *fyne.Conta ) bottomBox := container.NewHBox( - actionWrap, // left + actionWrap, // left + showWrap, layout.NewSpacer(), // flexible space cancelWrap, // right ) diff --git a/src/modules/runner/runner.go b/src/modules/runner/runner.go index bfc46c2..071b7c2 100644 --- a/src/modules/runner/runner.go +++ b/src/modules/runner/runner.go @@ -37,6 +37,7 @@ func FindMeshbookBinary() (bool, string) { if binaryFound { return true, binaryPath } else { + log.Println("binary not found!") return false, "" } } @@ -46,18 +47,17 @@ func RunMeshbook(binPath, bookPath, targGroup string) (bool, string) { if len(bookPath) == 0 { args = []string{"--help"} } else { - args = []string{"--nograce", "-mb", bookPath, "--group", targGroup} + args = []string{"--nograce", "--silent", "-mb", bookPath, "--group", targGroup} } log.Printf("running with parameters: %v", args) cmd := exec.Command(binPath, args...) - cOut, err := cmd.CombinedOutput() + outputData, err := cmd.CombinedOutput() if err != nil { log.Printf("something went wrong when running the command: %v", err) - log.Printf("captured output: %s", string(cOut)) - return false, "" + log.Printf("captured output: %s", string(outputData)) + return false, string(outputData) } - log.Printf("captured output: %s", string(cOut)) - return true, "" + return true, string(outputData) }