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.
List Dialog Returns None
techteej last edited by techteej
self.var = str(dialogs.list_dialog(title='Select a file type', items=[".txt", ".py"], multiple=False)) print self.var
Returns none when I select an item, any ideas why?
omz last edited by
Possible reason: You're calling this from the main UI thread (e.g. from a button action etc.). Blocking that thread would effectively "hang" the app, so
list_dialogreturns immediately, without waiting for a return value.
Try decorating your action/function with
@ui.in_background, like this:
@ui.in_background def my_action(sender): self.var = str(dialogs.list_dialog(title='Select a file type', items=[".txt", ".py"], multiple=False)) print self.var
techteej last edited by
@omz That was it, thanks. You could tell it's been a while!