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.
alert() prompt not visible
-
In 3.4, alert dialogs have stopped working for me on my iPad, at least in certain circumstances. (I had no issues with this in 3.3)
The app behaves like there is a modal dialog (i.e., it locks up), but the dialog doesn't show up. If I fiddle with the window by swiping up from the bottom bar to shrink it, sometimes the dialog does appear, but I still can't interact with it. If I do that a few times, sometimes it goes away.
Minimal example:
import ui import dialogs def quit_selected(sender): dialogs.alert("Quit", "Are you sure you want to quit?", "Quit") view = ui.load_view('MenuUI') view.present()
Where MenuUI just has a single button that calls quit_selected(). Can't test at the moment whether it only happens with load_view()
Happens regardless of whether it's presented as fullscreen or sheet. Same behavior with input_alert() as well.
However, if I just call alert after the last line, it works fine.
-
@bensaccount try
import ui import dialogs @ui.in_background def quit_selected(sender): dialogs.alert("Quit", "Are you sure you want to quit?", "Quit") view = ui.load_view('MenuUI ') view.present()
-
@cvp That works, thanks!
Is there any downside to just sticking that decorator on every UI callback that might lead to an alert or a database query? Seems like it would only be a problem if the function blocks the main (non-UI) thread, but that's no worse than blocking the main UI thread.
-
@bensaccount There are a lot of topics in this forum where this has been discussed because a lot of people have met the same issue 😀