dialog.run()
starts a main loop which runs until the user has closed the dialog or pressed one of its response buttons. For what you want, it would be better to call dialog.show()
instead.
Make sure you run the main loop (while Gtk.events_pending(): Gtk.main_iteration(False)
) after each call to change the progress bar; or update the progress bar in an idle function. Otherwise you won't see the changes.