Hey there everyone,
I'm looking into ways to have labels display values within a ui_control callback and then reset to their original label. For example, "Freq".
So far, all I've been able to come up with is using a for loop to create a timer, of sorts, that resets the text after the UI control has been set for a short period of time. The problem is that the amount of time it takes for the loop to complete seems to be inconsistent. If I actually move the knob, the label resets relatively quickly. If I simply click the knob and its value stays the same, the label seems to take longer to reset to its original text. Very strange.
I'm hoping someone might have a better solution than a for loop within the ui control callback.
Here's my compiled test code.
{ Compiled on Fri Jan 28 14:09:06 2022 }
on init
make_perfview
set_ui_height_px(100)
set_ui_width_px(700)
declare $i
declare ui_knob $test_knob(0, 1000000, 1)
declare ui_label $test_label(1, 1)
set_control_par(get_ui_id($test_knob),$CONTROL_PAR_POS_X,100)
set_control_par(get_ui_id($test_label),$CONTROL_PAR_POS_X,0)
set_control_par_str(get_ui_id($test_label),$CONTROL_PAR_TEXT,"TEST")
end on
on ui_control($test_knob)
set_control_par_str(get_ui_id($test_label),$CONTROL_PAR_TEXT,$test_knob)
$i := 0
while ($i<=1000)
if ($i=1000)
set_control_par_str(get_ui_id($test_label),$CONTROL_PAR_TEXT,"TEST")
end if
wait(10000)
inc($i)
end while
end on