ludic.ui, runtime: the last per-frame allocations in the interface - the top popover found without a list, the popover draw list and the clip stack kept, a select's options in a list the node keeps (and matched to its value without writing the index), a number's text kept on its Value until it changes (value_num_set / Value.num_text), a key's label kept per key code until the layout changes it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3915af34c2
commit
50f255eea4
10 changed files with 98 additions and 40 deletions
|
|
@ -50,3 +50,16 @@ function ct_submit(ui_st: mut UiState, n: UiNode) -> void {
|
|||
ui_fire(ui_st, n, "submit", ui_attr(n, "value"))
|
||||
if ui_attr_on(n, "clear-on-submit") { ui_fire(ui_st, n, "change", Value.str("")) }
|
||||
}
|
||||
# the text is exactly i's digits, compared without writing i out
|
||||
function ct_is_int(s: string, i: int) -> bool {
|
||||
if i < 0 or len(s) == 0 { return false }
|
||||
var n = i
|
||||
var at = len(s) - 1
|
||||
while at >= 0 {
|
||||
if s[at] != 48 + n % 10 { return false }
|
||||
n = n / 10
|
||||
at -= 1
|
||||
if n == 0 { return at < 0 }
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue