This is what happens when you dont test anything oh my god

This commit is contained in:
Sasha Koshka 2023-04-15 18:49:02 -04:00
parent 1044c8299a
commit c0b205c6f0
2 changed files with 8 additions and 9 deletions

View File

@ -63,7 +63,7 @@ func (ent *entity) setWindow (window *window) {
func (entity *entity) propagate (callback func (*entity) bool) { func (entity *entity) propagate (callback func (*entity) bool) {
for _, child := range entity.children { for _, child := range entity.children {
if callback(child) { break } if !callback(child) { break }
child.propagate(callback) child.propagate(callback)
} }
} }

View File

@ -1,8 +1,7 @@
package main package main
import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/popups" // 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/elements"
import "git.tebibyte.media/sashakoshka/tomo/elements/containers" import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
@ -15,7 +14,7 @@ func run () {
window, _ := tomo.NewWindow(tomo.Bounds(0, 0, 0, 0)) window, _ := tomo.NewWindow(tomo.Bounds(0, 0, 0, 0))
window.SetTitle("Checkboxes") window.SetTitle("Checkboxes")
container := containers.NewContainer(layouts.Vertical { true, true }) container := containers.NewVBox(true, true)
window.Adopt(container) window.Adopt(container)
introText := elements.NewLabel ( introText := elements.NewLabel (
@ -35,11 +34,11 @@ func run () {
vsync := elements.NewCheckbox("Enable vsync", false) vsync := elements.NewCheckbox("Enable vsync", false)
vsync.OnToggle (func () { vsync.OnToggle (func () {
if vsync.Value() { if vsync.Value() {
popups.NewDialog ( // popups.NewDialog (
popups.DialogKindInfo, // popups.DialogKindInfo,
window, // window,
"Ha!", // "Ha!",
"That doesn't do anything.") // "That doesn't do anything.")
} }
}) })
container.Adopt(vsync, false) container.Adopt(vsync, false)