Skip to content
Snippets Groups Projects
Select Git revision
  • 27c8e3bb8a4e20db314b9a47a1e9993b6687babd
  • master default protected
  • devel
  • adaptive_step_size
4 results

ui_run.go

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ui_run.go 1.00 KiB
    // 25 Jan 2020
    // Given a buffer or two with a plot picture, send it to the screen
    
    // +build !no_gfx
    
    package ui
    
    import (
    	"fyne.io/fyne/v2"
    	"fyne.io/fyne/v2/app"
    	"fyne.io/fyne/v2/container"
    	"fyne.io/fyne/v2/widget"
    
    	"example.com/ackley_mc/mc_work"
    )
    
    
    func initIn () *widget.Card {	
    	return widget.NewCard("input screen", "click on run to start a calc", nil)
    }
    
    func UiDoRun (mcPrm *mcwork.McPrm) error {
    
    	a := app.NewWithID("Monte Carlo")
    	w := a.NewWindow  ("Monte Carlo")
    	quitbutton := widget.NewButton ("quit .. click somwhere in here", a.Quit)
    	chn := make(chan workstatus)
    	inputTabCallback := func() (*fyne.Container) {
    		a, _ := inputTab(mcPrm, w, chn)
    		return a
    	}
    	t1 := container.NewTabItem("input tab", inputTabCallback())
    	cntrOut := fyne.NewContainer()
    	t2 := container.NewTabItem("output tab", cntrOut)
    	t3 := container.NewTabItem("quit me", quitbutton)
    	appTab := container.NewAppTabs(t1, t2, t3)
    	w.SetContent(appTab)
    	breaker()
    	go outputTab(chn, cntrOut)
    	w.ShowAndRun()
    	close (chn)
    	return nil
    }