How to disable all widgets while a function in running?

My application runs a simulation function which can take ~30-60 seconds to run.

I only realised now that while this is executing – and I have a progress bar ticking over for each iteration (see image) – the user’s able to click buttons, selectboxes etc. which freezes the execution and causes havoc.

I know I could conditionally disable every clickable element, but this will be a pita (dozens of elements, some with pre-existing disable conditions) and I assume this is a fairly common problem, perhaps with a cleaner solution?