p-ranav / indicators

Activity Indicators for Modern C++
MIT License
3.04k stars 237 forks source link

Dynamically set MaxProgress during iteration #127

Open lczech opened 1 year ago

lczech commented 1 year ago

Hi there!

Very cool tool, thanks for offering this to the community!

Feature request: I have a use case where I iterate over some range, but that range can change during the iteration. I'd like to use the iterable progress bar (with MaxProgress), so that the numbers of iterations are show, instead of just percentages.

However, I'd need to

bar.set_option(option::MaxProgress{
    new_max
});

in my loop. I'd expect that to update the max in the bar dynamically. That does not seem to work right now - the total remains at the initial value.

Is that doable somehow?

Thanks and cheers Lucas