omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    2
    5
    2922
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Grun6
      Grun6 last edited by Grun6

      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

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        try using @in_background

        1 Reply Last reply Reply Quote 0
        • Grun6
          Grun6 last edited by

          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

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            Right. forgot:
            https://forum.omz-software.com/topic/1119/can-t-show-an-alert/11

            use 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".

            1 Reply Last reply Reply Quote 0
            • Grun6
              Grun6 last edited by

              Thanks for the suggestions. I will try them !

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors