Jonah D. wrote:
how does one loop through a process while moving the gauge, without freezing
the program? If I loop through copying some files, it still moves the
gauge, but has a waiting cursor and is stuck. Is there a way to make it
do the operation, but not freeze?
There are several different ways to deal with long-running background
tasks. Probably the easiest one for this situation - where you have a
job that breaks down naturally into smaller pieces (individual files) -
is to use evt_idle. This is called whenever there is processing time
free. It would go something like this:
This should allow the task to progress in chunks while keeping the GUI
A more general approach to dealing with long-running tasks is to run
them in a background Thread. But this is considerably more complicated
for several reasons - eg you should not make GUI update calls from
subordinate threads. There are previous discussions and samples about
using Threads in wxRuby if that’s the way you want to go.