2024-05-07 18:22:07 -06:00
|
|
|
// Example inputs demonstrates the use of various user input methods.
|
|
|
|
package main
|
|
|
|
|
|
|
|
import "image"
|
|
|
|
import "git.tebibyte.media/tomo/tomo"
|
|
|
|
import "git.tebibyte.media/tomo/nasin"
|
|
|
|
import "git.tebibyte.media/tomo/objects"
|
|
|
|
// import "git.tebibyte.media/tomo/tomo/theme"
|
|
|
|
import "git.tebibyte.media/tomo/objects/layouts"
|
|
|
|
|
|
|
|
type Application struct { }
|
|
|
|
|
|
|
|
func (this *Application) Describe () nasin.ApplicationDescription {
|
|
|
|
return nasin.ApplicationDescription {
|
|
|
|
Name: "Tomo Input Example",
|
|
|
|
ID: "xyz.holanet.TomoInputExample",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *Application) Init () error {
|
|
|
|
window, err := nasin.NewApplicationWindow(this, image.Rect(0, 0, 128, 128))
|
|
|
|
if err != nil { return err }
|
|
|
|
|
2024-05-17 13:19:48 -06:00
|
|
|
window.SetRoot(objects.NewOuterContainer(layouts.ContractVertical,
|
2024-05-07 18:22:07 -06:00
|
|
|
objects.NewTextInput(""),
|
|
|
|
objects.NewHorizontalSlider(0.5),
|
|
|
|
objects.NewLabelCheckbox(false, "checkbox"),
|
2024-05-07 18:25:15 -06:00
|
|
|
objects.NewNumberInput(5),
|
2024-05-07 18:22:07 -06:00
|
|
|
))
|
|
|
|
|
|
|
|
window.OnClose(tomo.Stop)
|
|
|
|
window.Show()
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func main () {
|
|
|
|
nasin.RunApplication(&Application { })
|
|
|
|
}
|