Dialog problem when using Python

When running a dialog from a Python script, I am having an impossible time letting the user know that processing is taking place and to wait. This is not a problem when running a Basic macro.

The attached sample demonstrates each process

Click the Run Dialog from Basic button to open the dialog. Click the Execute Process button and the message will change every second (only 4) leaving the last on the dialog.

Next the Run Dialog from Python button. Click the Execute Process button (wait about 5 seconds after clicking) only displays the final message. The Python script completes but never displays the individual messages. There is no ability to update dialog information while the script is running. Therefore, the user doesn’t know what is happening.

One more point. The Progress Bar control has not been available for over 20 months now due to a regression around the release of v5.0.x - see Bug #95173. Even if it was, based on this problem, not sure how to update it. You can place the control but it is not visible!

Further testing shows the Progress Bar is working in Basic. It is not visible when placed on dialog but progress displays. In Python, however, again there are no updated steps displayed. Only the final 100% display.

Have tried numerous things in past week but all fail. Only one I haven’t tried (because of not being sure how) is addPaintListener but not really sure this is an answer.

Sample: DialogProblem.ods (used Calc document since involves my project)

Just the Code: DialogCode.odt

Any direction appreciated!

EDIT: Please note, this has now been cross posted in AOO forum here.

This question has been resolved in the AOO Forum by sasa (link presented in Question). Here is the method provided:

# ...
from threading import Thread
# ...
# -----------------------------------------------------------
#               Action event
# -----------------------------------------------------------
def btnCirToLat_OnClick(self):
    self.t = Thread(target=self.workerCirToLat)  # , args = (doc,))
# -----------------------------------------------------------
#               Worker
# -----------------------------------------------------------
def workerCirToLat(self):
    self.translitWriterAll(language_code='sr', reversed=True)
    # or write engine code here 
# -----------------------------------------------------------
#               Engine
# -----------------------------------------------------------
def translitWriterAll(self, language_code='sr', reversed=True):
    # ...
    # set progressbar values
    self.pbProgress.ProgressValue = 0
    self.pbProgress.ProgressValueMin = 0
    self.pbProgress.ProgressValueMax = 100
    # ...
    n = 0
    for word, translation in words_dict.items():
        # ...
        n += 1
        self.pbProgress.ProgressValue = n
# ...

I have tested this with both text messaging and the Progress Bar and both work.