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`
-
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 mymain
function. Can I somehow wait for the result ? -
@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 callmy_queue.put(value)
and your main code can wait for it withvalue = my_queue.get()
. -
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???)
-
@halloleooo, unfortunately, all email notifications, including password resets, have been broken for about a year now.
-
@mikael Good to know. Thanks!
-
Reacting to a UI element inside a Native UI environment requires intricate handling and seamless integration. Leveraging React's capabilities within the Native UI structure empowers developers to dynamically respond to user interactions, ensuring a fluid and responsive user experience. Careful implementation allows for efficient updates and interactions within the Native UI, enhancing overall usability and functionality.