Updated everything else to match

This commit is contained in:
2023-02-02 01:48:16 -05:00
parent 99942466f8
commit 892c74a9da
40 changed files with 304 additions and 759 deletions

View File

@@ -2,7 +2,8 @@ package main
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/popups"
import "git.tebibyte.media/sashakoshka/tomo/layouts"
import "git.tebibyte.media/sashakoshka/tomo/elements"
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
import "git.tebibyte.media/sashakoshka/tomo/elements/testing"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/x"
@@ -15,11 +16,11 @@ func run () {
window, _ := tomo.NewWindow(300, 2)
window.SetTitle("List Sidebar")
container := basic.NewContainer(layouts.Horizontal { true, true })
container := basicElements.NewContainer(basicLayouts.Horizontal { true, true })
window.Adopt(container)
var currentPage tomo.Element
turnPage := func (newPage tomo.Element) {
var currentPage elements.Element
turnPage := func (newPage elements.Element) {
container.Warp (func () {
if currentPage != nil {
container.Disown(currentPage)
@@ -29,27 +30,27 @@ func run () {
})
}
intro := basic.NewLabel (
intro := basicElements.NewLabel (
"The List element can be easily used as a sidebar. " +
"Click on entries to flip pages!", true)
button := basic.NewButton("I do nothing!")
button := basicElements.NewButton("I do nothing!")
button.OnClick (func () {
popups.NewDialog(popups.DialogKindInfo, "", "Sike!")
})
mouse := testing.NewMouse()
input := basic.NewTextBox("Write some text", "")
form := basic.NewContainer(layouts.Vertical { true, false})
form.Adopt(basic.NewLabel("I have:", false), false)
form.Adopt(basic.NewSpacer(true), false)
form.Adopt(basic.NewCheckbox("Skin", true), false)
form.Adopt(basic.NewCheckbox("Blood", false), false)
form.Adopt(basic.NewCheckbox("Bone", false), false)
input := basicElements.NewTextBox("Write some text", "")
form := basicElements.NewContainer(basicLayouts.Vertical { true, false})
form.Adopt(basicElements.NewLabel("I have:", false), false)
form.Adopt(basicElements.NewSpacer(true), false)
form.Adopt(basicElements.NewCheckbox("Skin", true), false)
form.Adopt(basicElements.NewCheckbox("Blood", false), false)
form.Adopt(basicElements.NewCheckbox("Bone", false), false)
list := basic.NewList (
basic.NewListEntry("button", func () { turnPage(button) }),
basic.NewListEntry("mouse", func () { turnPage(mouse) }),
basic.NewListEntry("input", func () { turnPage(input) }),
basic.NewListEntry("form", func () { turnPage(form) }))
list := basicElements.NewList (
basicElements.NewListEntry("button", func () { turnPage(button) }),
basicElements.NewListEntry("mouse", func () { turnPage(mouse) }),
basicElements.NewListEntry("input", func () { turnPage(input) }),
basicElements.NewListEntry("form", func () { turnPage(form) }))
list.OnNoEntrySelected(func () { turnPage (intro) })
list.Collapse(96, 0)