pbtick function

Update progress if the progress bar is not NULL.