[Solved] Dialog problem - Updating using Python
Posted: Thu Jul 13, 2017 8:16 pm
When running a dialog from a Python script, I have not found a method to let the user know that processing is taking place and to wait. This is not a problem when running from a Basic macro.
Note: This is cross posted on ask.LibreOffice: https://ask.libreoffice.org/en/question ... ng-python/. Trying here as other post has had no response.
Originally developed using LO v5.3.4.2 but same results on AOO v4.0.1.
As background, here is why I chose this method. The use is in Calc. The process inserts graphic information tied to selected cells. The dialog allows a variety of settings. Once selected, the user clicks a button to insert the info. If the result is not acceptable, the user can clear, adjust setting(s) and re-run. The Dialog is non-modal so the user can then select new cells or a different sheet & apply there.
The attached sample demonstrates the problem.
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). It 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.
The `Run Python Dialog with Progress Bar` basically operates the same as the previous Python button. It uses an IDE dialog & the progress bar update only displays when code 100% completed. The individual stepping is never seen. The progress bar is present, just not visible in display or IDE (been like this for some time).
Have tried numerous things in past week but all fail.
Any direction appreciated!
Note: This is cross posted on ask.LibreOffice: https://ask.libreoffice.org/en/question ... ng-python/. Trying here as other post has had no response.
Originally developed using LO v5.3.4.2 but same results on AOO v4.0.1.
As background, here is why I chose this method. The use is in Calc. The process inserts graphic information tied to selected cells. The dialog allows a variety of settings. Once selected, the user clicks a button to insert the info. If the result is not acceptable, the user can clear, adjust setting(s) and re-run. The Dialog is non-modal so the user can then select new cells or a different sheet & apply there.
The attached sample demonstrates the problem.
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). It 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.
The `Run Python Dialog with Progress Bar` basically operates the same as the previous Python button. It uses an IDE dialog & the progress bar update only displays when code 100% completed. The individual stepping is never seen. The progress bar is present, just not visible in display or IDE (been like this for some time).
Have tried numerous things in past week but all fail.
Any direction appreciated!