This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
tomo-old/examples/scroll/main.go

28 lines
785 B
Go
Raw Normal View History

package main
import "git.tebibyte.media/sashakoshka/tomo"
2023-02-01 23:48:16 -07:00
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/x"
func main () {
tomo.Run(run)
}
func run () {
window, _ := tomo.NewWindow(2, 2)
window.SetTitle("Scroll")
2023-02-01 23:48:16 -07:00
container := basicElements.NewContainer(basicLayouts.Vertical { true, true })
window.Adopt(container)
2023-02-01 23:48:16 -07:00
container.Adopt(basicElements.NewLabel("look at this non sense", false), false)
2023-02-01 23:48:16 -07:00
textBox := basicElements.NewTextBox("", "sample text sample text")
scrollContainer := basicElements.NewScrollContainer(true, false)
scrollContainer.Adopt(textBox)
2023-01-19 16:03:50 -07:00
container.Adopt(scrollContainer, true)
window.OnClose(tomo.Stop)
window.Show()
}