PtProgress not progressing

I’m trying to use the PtProgress wigdet to show the progress of a network transmission. I have a while loop that transmits 1kB each 1ms and I want to show this progress, however the progress bar do not showing intermediate values, just 0 and, at end, 100. Anyone can help me?

I discover! The problem is that my transmission process were inside a button callback. How photon has only one thread to process the IHM callbacks, it just increment the progress after exit the button callback.

use PtFlush() after u did PtSetResource(…)