Multiple render calls in a for loop, how to refresh UI in between / exit loop?

I’m changing the position of an object in a scene within a for-loop. After every change i call the render()-method of the API. In Blender 2.49 the render window updated for every rendering. In 2.57 the blender window just freezes until the for loop is finished.

How can i force a feedback to the user while the loop is running? I’d like to have something like “Rendered image 1 of 6”, “Rendered image 2 of 6” on the UI.

Also i’d like to know, how to exit the loop by the user pressing a “Stop” button. Do i need to use threads for this?

Thanks,
Stephan