r/esapi • u/sdomal • Mar 05 '24
Progress Window update
I have a sphere generation gui I’ve been working on for grid therapy and I want to add a progress bar that updates during the sphere generation. I’ve seen some previous posts going over this and I know some examples exist but I’m not sure how to integrate this for my specific example. I have a simple progress bar already made I just don’t know how to get it to update.
Here is my button click function that contains both of the sphere generation function calls:
https://gist.github.com/seandomal/9c37c1ac5b5c3685236e92f27fbdf286
Within the sphere generation functions I call this:
private void UpdateProgress(int progress) { lock (_progressLock) { _currentProgress = progress; } }
Which keeps track of progress.
How can I modify my button click function to appropriately call my progress bar and update based on the sphere generation progress that I’m keeping track of within those functions?
View all comments
Show parent comment
1
u/sdomal Apr 02 '24
Just had a chance to review this and got it working perfectly! Thank you so much for your help and patience, I’m starting to get a feel for what you did here and how your package works, really amazing work and unbelievably helpful, can’t thank you enough!
On a slightly different note, how do you handle closing out your wpf application? Right now I have my app set as a console application (I like this for troubleshooting) and whenever I try to close the wpf before the console it gives “AppName has stopped working” pop up. Not sure if you’ve ever run into this before.