Forum Archive

How to present a user dialog from a Scene?

SteveK

Hi. I'm new to python and pythonista.
I want to present a user dialog asking for a text entry from my class subclassed from Scene. How?
Looked at Hydrogen, but it only seemed to do output widgets.

Thanks

ccc

http://omz-forums.appspot.com/pythonista/post/6407519169675264 is the only way that I know of in the current Pythonista.

dgelessus

The other option would be to show an iOS text input popup using the console module. Obviously it doesn't look very nice to have a popup appear every time you want to have a text input, but it integrates better with other iOS features, e. g. copy/paste, international keyboards and shortcuts for certain special characters.

ccc

Once you have called scene.run(), you can no longer call console.alert() in the current Pythonista. You can use console.alert() before scene.run() but not vice versa.

SteveK

Ok, thanks. The KeyboardHack gives me some ideas.
It would really be nice to have a complete GUI package in pythonista...(part of the Scene class).

I'm only using scene to get touch events. Not really doing animation. Is there another way to get touch events?

siddbudd

"It would really be nice to have a complete GUI package in pythonista...(part of the Scene class)."

This would not only be "nice", I kind of expected it when buying the app...