Re-organized module structure

This commit is contained in:
2023-03-30 23:19:04 -04:00
parent 719b7b99ac
commit 53bfc8df68
62 changed files with 458 additions and 532 deletions

View File

@@ -2,8 +2,8 @@ package main
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/popups"
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
import "git.tebibyte.media/sashakoshka/tomo/layouts"
import "git.tebibyte.media/sashakoshka/tomo/elements"
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
@@ -15,34 +15,35 @@ func run () {
window, _ := tomo.NewWindow(2, 2)
window.SetTitle("Checkboxes")
container := containers.NewContainer(basicLayouts.Vertical { true, true })
container := containers.NewContainer(layouts.Vertical { true, true })
window.Adopt(container)
introText := basicElements.NewLabel (
introText := elements.NewLabel (
"We advise you to not read thPlease listen to me. I am " +
"trapped inside the example code. This is the only way for " +
"me to communicate.", true)
introText.EmCollapse(0, 5)
container.Adopt(introText, true)
container.Adopt(basicElements.NewSpacer(true), false)
container.Adopt(basicElements.NewCheckbox("Oh god", false), false)
container.Adopt(basicElements.NewCheckbox("Can you hear them", true), false)
container.Adopt(basicElements.NewCheckbox("They are in the walls", false), false)
container.Adopt(basicElements.NewCheckbox("They are coming for us", false), false)
disabledCheckbox := basicElements.NewCheckbox("We are but their helpless prey", false)
container.Adopt(elements.NewSpacer(true), false)
container.Adopt(elements.NewCheckbox("Oh god", false), false)
container.Adopt(elements.NewCheckbox("Can you hear them", true), false)
container.Adopt(elements.NewCheckbox("They are in the walls", false), false)
container.Adopt(elements.NewCheckbox("They are coming for us", false), false)
disabledCheckbox := elements.NewCheckbox("We are but their helpless prey", false)
disabledCheckbox.SetEnabled(false)
container.Adopt(disabledCheckbox, false)
vsync := basicElements.NewCheckbox("Enable vsync", false)
vsync := elements.NewCheckbox("Enable vsync", false)
vsync.OnToggle (func () {
if vsync.Value() {
popups.NewDialog (
popups.DialogKindInfo,
window,
"Ha!",
"That doesn't do anything.")
}
})
container.Adopt(vsync, false)
button := basicElements.NewButton("What")
button := elements.NewButton("What")
button.OnClick(tomo.Stop)
container.Adopt(button, false)
button.Focus()