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,14 +3,18 @@ package main
import "fmt"
import "image"
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(200, 200, 256, 256))
type Application struct { }
func (Application) Init () error {
window, err := nasin.NewWindow(tomo.Bounds(200, 200, 256, 256))
if err != nil { return err }
window.SetTitle("Main")
container := elements.NewVBox (
@@ -18,13 +22,14 @@ func run () {
elements.NewLabel("Main window"))
window.Adopt(container)
window.OnClose(tomo.Stop)
window.OnClose(nasin.Stop)
window.Show()
createPanel(window, 0, tomo.Bounds(-64, 20, 0, 0))
createPanel(window, 1, tomo.Bounds(200, 20, 0, 0))
createPanel(window, 2, tomo.Bounds(-64, 180, 0, 0))
createPanel(window, 3, tomo.Bounds(200, 180, 0, 0))
return nil
}
func createPanel (parent tomo.MainWindow, id int, bounds image.Rectangle) {