Updated code at https://gist.github.com/LandyQuack/5183934 adds a clickable text label. All still a bit rough and ready but a useful enough start.
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.
Latest posts made by Landyquack38
-
RE: Are there code samples on how to create forms and lists?
-
RE: Interactive Form Example
Thanks for this - most of the time the browser beat the server but occasionally it didn't so bunged the browser into a threading.Timer() which solved things.
As a solution, it's a bit kludgy. Sometimes closing the webbrowser closes the whole script, sometimes it doesn't.
Had a look at what's possible within Scene - only at early stages but this may interest - http://omz-software.com/pythonista/forums/discussion/comment/715#Comment_715
-
RE: Are there code samples on how to create forms and lists?
@uncleWalter - yup, will dig one out but hopefully something more interesting first.
Basically, I don't want to create a web server based app rendered in a separate webbrowser (embedded or standalone). I don't want to have to think about 10 minute time outs or anything similar... I want to write proper GUI apps in Pythonista.
Reading a shedload of links, it's clear that there's some debate about whether or not Pythonista can allow access to native controls (although ScriptKit seems to do it). For something I'm writing now, I only really need some buttons and (if I can) a combobox so I wondered if I could implement a gui using scenes and layers.
The code at https://gist.github.com/LandyQuack/5182877 is at a very early stage but it basically demonstrates creating two buttons (bordered rectangles for now) which respond to touch by playing a sound. It's nothing fancy but, it may be enough for some.
Essentially, I noticed that Layers are moveable rectangular screen areas which can have a border, a Scene is basically the outer window of a gui app, the master Scene knows which layers have been added and they in turn know which layers have been added to them. Touch events know which layer generated them so...
Sounded enough like windows (as a base for controls) to be worth playing with.
So far, I've got a couple of Button controls which automatically add themselves to a parent window (the scene) and touch events caught in the outer Scene (the app) and passing the touch event to the layer which generated it.
Haven't explored events within sub layers yet e.g. a bar of buttons (a layer containing say half a dozen sub layers which behave as button).
Hope this helps someone.
-
RE: Are there code samples on how to create forms and lists?
And Bottle (import bottle, dir(bottle)) makes REST trivial
-
RE: Interactive Form Example
New to Pythonista but old to Python. Stunningly useful app on an iPad2.
Been following this thread as a means to build UI for a prototype medical data collection form. Although web interface not ideal, understand that wxPython, iOS native controls all largely blocked by Apple so best available option for now.
Thought I'd throw bottle (import bottle dir(bottle)) into the mix... It's in Pythonista by default and makes REST based web interfaces trivial and has templating libs.
Need to find a way to create a web browser from within a bottle based app (thread?) but does Ajax and much that would be useful for interactive interface like the google search predictor etc.
Hope this helps someone