Closed SeSodesa closed 1 year ago
Correction, it does progress, after 5 iterations of a 10-iteration loop. But since one step of said test loop takes a while, the user is left wondering if anything is progressing at all.
Closed by the merge of #239.
Description
The function
zef_waitbar
does the following assignment right when the function starts:https://github.com/sampsapursiainen/zeffiro_interface/blob/a3d39452d78f898028be437c225bc1fe8da7782b/m/zef_waitbar.m#L2-L5
This is later used to determine whether the function does anything, when the third argument is a string that the waitbar should update:
https://github.com/sampsapursiainen/zeffiro_interface/blob/a3d39452d78f898028be437c225bc1fe8da7782b/m/zef_waitbar.m#L43-L56
If a loop which utilizes
zef_waitbar
to display progress then has less than 500 iterations (or something to that effect), it seems that the waitbar will never be updated. I am aware that we need a condition like this to prevent loops with millions of laborious iterations taking longer than necessary, because updating the waitbar is a rather slow operation, but this hard-coded threshold value needs to be handled differently. Otherwisezef_waitbar
will be useless with loops that only have a "few" iterations.Steps to reproduce
zef_waitbar
before a loop with, say, 300 iterations:wb = zef_waitbar(0, "Title.");
,ii
and the number of iterationsN
is300
, update the waitbar with text that shows the progress:zef_waitbar(ii / N, wb, "Title: " + ii + " / " + N);
andzef_waitbar
is called.Expected behavior
The waitbar updated with the call
zef_waitbar(<progress_ratio>, <waitbar_handle>, <progress_text>)
should also update itself in the case of loops that contain only a few iterations.Context