#91 get and set values for all controls/indicators and textbox

This commit is contained in:
Mikayla Fischler
2022-09-12 12:59:28 -04:00
parent d9be5ccb47
commit 10c53ac4b3
16 changed files with 192 additions and 60 deletions

View File

@@ -42,6 +42,8 @@ local function hbar(args)
-- handle data changes
function e.on_update(fraction)
e.value = fraction
-- enforce minimum and maximum
if fraction < 0 then
fraction = 0.0
@@ -96,6 +98,18 @@ local function hbar(args)
end
end
---@param bar_fg_bg cpair new bar colors
function e.recolor(bar_fg_bg)
bar_bkg = bar_fg_bg.blit_bkg
bar_fgd = bar_fg_bg.blit_fgd
-- re-draw
last_num_bars = 0
e.on_update(e.value)
end
function e.set_value(val) e.on_update(val) end
-- initialize to 0
e.on_update(0)