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

@@ -1,14 +1,18 @@
package main
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, 360, 0))
type Application struct { }
func (Application) Init () error {
window, err := nasin.NewWindow(tomo.Bounds(0, 0, 360, 0))
if err != nil { return err }
window.SetTitle("Icons")
container := elements.NewVBox(elements.SpaceBoth)
@@ -25,11 +29,12 @@ func run () {
closeButton := elements.NewButton("Yes verynice")
closeButton.SetIcon(tomo.IconYes)
closeButton.OnClick(tomo.Stop)
closeButton.OnClick(window.Close)
container.Adopt(closeButton)
window.OnClose(tomo.Stop)
window.OnClose(nasin.Stop)
window.Show()
return nil
}
func icons (min, max tomo.Icon) (container *elements.Box) {