Display: review r1 fixes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 12:31:17 -04:00
1 parent 2a232930dd
commit 822e7a673a
31 files changed
+409 -156

No files matched your search

+9
View File
@@ -1,6 +1,8 @@
package main
import (
"fmt"
"github.com/egoist/mygo/ui"
mujica "mujicaui"
@@ -30,3 +32,10 @@ func displayCode(c *ui.Context, code string, log func(string)) {
mujica.Text(c, code, mujica.TextOptions{Selectable: true}).Font(theme.MonoFont).FontSize(12)
})
}
// displayLog logs a control's new value when it changed.
func displayLog[T any](log func(string), e *ui.Element, name string, v *T) {
if e.Changed() {
log(fmt.Sprintf("%s = %v", name, *v))
}
}