I could reproduce your error with my_view.wait_modal() at the end, therefore I assume it to be the problem. As soon as you leave this line out it works. Can you by any chance restructure your code in a way to make .wait_modal() not necessary?
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Latest posts made by MatthiasLehner
-
RE: Can't show an alert?
-
RE: Can't show an alert?
That usually shouldn't be the problem then. Would you mind posting a little more of your code to give me more insight on what might be causing the problem ?
-
RE: Can't show an alert?
I unluckily am not able to reproduce your problem, therefore I can just make assumptions. Do you call any functions beyond the "alert ('The message to show in the alert')" call that might interfere with the ui? This might lead to unexpected behavior as your alert and anything you call beyond console.alert run on different threads. Do you maybe have any calls beyond this, that access the console?
-
RE: Can't show an alert?
You have to decorate the function you are trying to show the alert from with "@ui.in_background".
@ui.in_background def your_function(sender): console.alert()