#91 get and set values for all controls/indicators and textbox
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user