All examples work
This commit is contained in:
@@ -2,15 +2,19 @@ package main
|
||||
|
||||
import "time"
|
||||
import "git.tebibyte.media/sashakoshka/tomo"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/nasin"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/popups"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/elements"
|
||||
|
||||
func main () {
|
||||
tomo.Run(run)
|
||||
nasin.Run(Application { })
|
||||
}
|
||||
|
||||
func run () {
|
||||
window, _ := tomo.NewWindow(tomo.Bounds(0, 0, 0, 0))
|
||||
type Application struct { }
|
||||
|
||||
func (Application) Init () error {
|
||||
window, err := nasin.NewWindow(tomo.Bounds(0, 0, 0, 0))
|
||||
if err != nil { return err }
|
||||
window.SetTitle("Approaching")
|
||||
container := elements.NewVBox(elements.SpaceBoth)
|
||||
window.Adopt(container)
|
||||
@@ -22,19 +26,20 @@ func run () {
|
||||
button.SetEnabled(false)
|
||||
container.Adopt(button)
|
||||
|
||||
window.OnClose(tomo.Stop)
|
||||
window.OnClose(nasin.Stop)
|
||||
window.Show()
|
||||
go fill(window, bar)
|
||||
return nil
|
||||
}
|
||||
|
||||
func fill (window tomo.Window, bar *elements.ProgressBar) {
|
||||
for progress := 0.0; progress < 1.0; progress += 0.01 {
|
||||
time.Sleep(time.Second / 24)
|
||||
tomo.Do (func () {
|
||||
nasin.Do (func () {
|
||||
bar.SetProgress(progress)
|
||||
})
|
||||
}
|
||||
tomo.Do (func () {
|
||||
nasin.Do (func () {
|
||||
popups.NewDialog (
|
||||
popups.DialogKindInfo,
|
||||
window,
|
||||
|
||||
Reference in New Issue
Block a user