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.
console.alert makes screen unresponsive when called from within form_dialog window
-
Hello,
I am running into the following problem: when I call a console.alert() from within a form_dialogs, the screen freezes completely and becomes unresponsive. Is there a way around it?
To illustrate:import console, dialogs fields = [{‘type’:’check’, ‘key’:’testing’, ‘title’:’atest’ }] dialogs.form_dialog(fields = fields)
And in the dialogs.py module, in the tableview_did_select function, right under
if t == ‘check’
, add:console.alert('this','is','a','test')
Any help is much appreciated,
G -
try using @in_background
-
Yep I've tried but it pushes the window prompt behind the form_dialog window and makes it unusable.
Would you be willing to have a look at it, I could send you my files/github repo to run on your side.
Thanks,
G -
Right. forgot:
https://forum.omz-software.com/topic/1119/can-t-show-an-alert/11use console.hud_alert for simple notifications.
Alternatively, you might need to use a thread, or maybe dismiss the dialog first -- cnsole.alert doesn'tplay nice with wait_modal.
Alternatively, you can attach your own view to a "shield view".
-
Thanks for the suggestions. I will try them !