• nerdtron

    @Phuket2 thank you very much for the reply and help! Been tied up with other stuff and so have been delayed in getting back to this. I gave that a try and it looked great! I'm curious, though, any thoughts on how to set it up so that when you rotate the device its still correct? I see you're not using flex and from the docs it seems that this is how dynamic layout is normally done. Maybe its a matter of just re-computing using your code when the orientation changes?

    posted in Pythonista read more
  • nerdtron

    I’m trying to create a simple UI in Pythonista for my iPhone 6.

    I’d like to have a single line text box and a button at the top of the screen. The button should be at the upper right and be sized to fit the button’s name text.

    The text box should be the same height as the button and be located to the left of the button and fill the remaining width. I will then fill the remainder of the screen with a SceneView (not yet added).

    The idea is that you can type some text into the text field and then click the button to apply the text to the scene. I would rather not use a layout file and keep it all in a single script file so I’m trying to do it from code.

    I’ve experimented with this using the UI module docs but can’t get it quite working.

    Here’s what I have. Any suggestions on how to get this to do what I want?

    import ui

    view = ui.View()
    view.name = 'test UI'
    view.background_color = 'black'

    r = ui.Button(title='Add Item')
    r.background_color = 'orange'
    r.flex = 'BL'

    s = ui.TextField()
    s.flex = 'BR'
    view.add_subview(s )


    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!