Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I stop bar completing while total still being calculated #48

Closed
sethkor opened this issue Jul 14, 2019 · 4 comments · Fixed by #65
Closed

Can I stop bar completing while total still being calculated #48

sethkor opened this issue Jul 14, 2019 · 4 comments · Fixed by #65

Comments

@sethkor
Copy link

sethkor commented Jul 14, 2019

Hello,
Is it possible to prevent a bar from completing until the final total is set?

My problem is the code to determine size is slower than the code to process items so the bar completes before I have a chance to set the final total.

In the interim I have worked around by artificially adding an extra item to the total at the start and then subtracting this at the end.

Cheers
Seth

@vbauerster
Copy link
Owner

Hello,
Bar never completes if total set to zero.

@vbauerster
Copy link
Owner

Also fyi, you can trigger complete event manually with SetTotal.

@sethkor
Copy link
Author

sethkor commented Jul 14, 2019

Sorry I may not have been clear. What I want is for complete event to not trigger if the bars current count equals the total. In order to prevent this from happening now, I increment the total by 1 and then once I know it should complete I decrement total by 1 and set complete to true

@vbauerster
Copy link
Owner

Doesn't this example suit your needs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants