All examples work

This commit is contained in:
2023-05-03 15:23:42 -04:00
parent 4f8469c359
commit 8d587ae3b4
14 changed files with 112 additions and 58 deletions

View File

@@ -3,18 +3,23 @@ package main
import "os"
import "path/filepath"
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/nasin"
import "git.tebibyte.media/sashakoshka/tomo/elements"
func main () {
tomo.Run(run)
nasin.Run(Application { })
}
func run () {
window, _ := tomo.NewWindow(tomo.Bounds(0, 0, 384, 384))
type Application struct { }
func (Application) Init () error {
window, err := nasin.NewWindow(tomo.Bounds(0, 0, 384, 384))
if err != nil { return err }
window.SetTitle("File browser")
container := elements.NewVBox(elements.SpaceBoth)
window.Adopt(container)
homeDir, _ := os.UserHomeDir()
homeDir, err := os.UserHomeDir()
if err != nil { return err }
controlBar := elements.NewHBox(elements.SpaceNone)
backButton := elements.NewButton("Back")
@@ -77,6 +82,7 @@ func run () {
elements.NewScroll(elements.ScrollVertical, directoryView))
container.Adopt(statusBar)
window.OnClose(tomo.Stop)
window.OnClose(nasin.Stop)
window.Show()
return nil
}