omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Pre fill Textfield

    Pythonista
    2
    2
    2015
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • swoiwode
      swoiwode last edited by

      Porting over code from a Tinker desktop application. To improve the user experience I am used to populating input field values with those last entered at last runtime. Something that was part of the Palm programming standard, using preferences. So I think I need to understand how to 'see' a Textfield and set the text value with <variable name>.set(parser.get(<key>,<token>) before it is display, or just afterward. With Tinker this was done with <variable name> = tk.StringVar(). As a side note, I'd like to get the InputText = sender.superview['InputText'] outside of the Button def too. Thanks, Scott

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        Are you creating your ui's programatically, or with ui editor?
        If using the editor, you would do

        v=load_view('myview')
        v['textfield1'].text = sometext
        

        where textfield1 is replaced with whatever you named your textfield. If you have multiple layers of views, you will need to address each level, e.g.

        v['textframe']['textfield1']
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors