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.


    React to a UI element inside `@ui.in_background`

    Pythonista
    2
    5
    2035
    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.
    • halloleooo
      halloleooo last edited by

      When I put a UI element via @ui.in_background in the background, how can I react to the result in my normal (foreground) flow?

      Say I have dialogs.list_dialog and I want to do something with the result of the list in my main function. Can I somehow wait for the result ?

      mikael 1 Reply Last reply Reply Quote 0
      • mikael
        mikael @halloleooo last edited by mikael

        @halloleooo, you can use the queue module.

        If both the main and background code see the same my_queue = queue.Queue() (can be global, or passed as a parameter to the bg function), then your bg code can call my_queue.put(value) and your main code can wait for it with value = my_queue.get().

        1 Reply Last reply Reply Quote 1
        • halloleooo
          halloleooo last edited by

          Thanks @mikael

          Much appreciated your tip. I will try this. :-)

          (Very strange though that I didn't not get any email notification about your reply... Does this forum not send emails out???)

          mikael 1 Reply Last reply Reply Quote 0
          • mikael
            mikael @halloleooo last edited by

            @halloleooo, unfortunately, all email notifications, including password resets, have been broken for about a year now.

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

              @mikael Good to know. Thanks!

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