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 module problems
-
When I have a UI file to go with a program I am making, I usually try to implement the use of console functions like consol.alert(). But I can't do this because every time I do, it always gives me an error that says:
"AssertionError: Cannot show alert from main UI thread."
If anybody could help me out with this, it would be much appreciated!
Thank you. -
If it's in a function, use
@ui.in_background
It should look like:
@ui.in_background def action(sender): console.alert("test")
-
instead of console.alert, consider using console.hud_alert. unless you need the user to press ok, using console.alert causes more problems than it solves!
if you DO need the user to acknowledge, you really want a "shield" over your ui, and implement callbacks. see the "confirm" method in gitui.py here:
https://github.com/jsbain/gitview.git
the beta has a
dialogs
module which implements some of these ideas as well.