All examples work
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user