I have an application that uses a bash script to load files and folders into a listbox. Depending on the size of the data, this action can lock up the screen for quite some time. How do I get my thread to act on the method that runs the bash script to get a progress bar to display the process and free up the main application?
While a thread cannot touch the UI without giving an Exception, it can read and write to variables. I write to a percentComplete variable which a Timer displays. I can also get the thread to look for a Cancel Boolean variable to know if its time to quit early.
I have looked at the underpinnings of the Thread.Run action. Documentation says it can run a method from within it. However, when I try to do just that, the application hangs and reports being Unresponsive. Any ideas?
The link is repaired for downloading the book. For some reason the website automatically deleted any file with a .zip suffix… I am repopulating the site now, and you should be able to download the book at the website:
Let me try to explain more clearly. My app has a main window with a toolbar. When I click on one of the buttons, a sheet window appears to provide the user with certain functionality. One of those functions is to be able to press a button and have a listbox populate with the path of the selected files and folders and to calculate the size of those items. Depending on the size of the data, this can cause my application to freeze until it is done. Sorry, this is done WITHOUT having to use a shell script. I was thinking of another button that launches a shell script.
Is it even possible, in this scenario, to have a progress bar that indicates the time to finish and allow the user to interact with the app while the process is running? If so, where would I put the Thread & Timer to make this happen.
I apologize for the lack of substance on my earlier posts.