Add examples

This commit is contained in:
2024-05-07 20:22:07 -04:00
parent d90fb327db
commit da4af8d240
4 changed files with 52 additions and 6 deletions

View File

@@ -8,6 +8,8 @@ import "git.tebibyte.media/tomo/objects"
import "git.tebibyte.media/tomo/tomo/theme"
import "git.tebibyte.media/tomo/objects/layouts"
const scrollIcons = false
type Application struct {
size theme.IconSize
grid tomo.ContainerBox
@@ -50,9 +52,16 @@ func (this *Application) Init () error {
container := objects.NewOuterContainer (
layouts.NewGrid([]bool { true }, []bool { false, true, false }),
objects.NewLabel("A smorgasbord of icons:"),
this.grid,
iconButtons)
objects.NewLabel("A smorgasbord of icons:"))
if scrollIcons {
iconScroller := objects.NewScrollContainer(objects.ScrollVertical)
this.grid.SetOverflow(false, true)
iconScroller.SetRoot(this.grid)
container.Add(iconScroller)
} else {
container.Add(this.grid)
}
container.Add(iconButtons)
window.SetRoot(container)
window.OnClose(tomo.Stop)