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.


    How to set focus to textfield (2)

    Pythonista
    3
    4
    4173
    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.
    • PetervdKamp
      PetervdKamp last edited by

      How to set focus to a textfield was subject of an earlier forum discussion. The solution that was given is to call textfield.begin_editing() (as present in the delegate). This method is not implemented in the current version of Pythonista. Instead there are textfield_did_begin_editing and textfield_should_begin_editing. I used both methods to give focus to a textfield, without result. So, is it still possible to give focus to a textfield? If yes, what do I wrong?

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

        Interesting. I thought I was only imagining things when I thought that there was a begin_editing method before, but it seems that that method was removed at some point.

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

          What are you considering the 'latest version'? 1.6 beta, or 1.5?

          Although begin_editing is missing from the docs, in 1.5 it is present for both TextView and TextField. Note that this method is called on the TextField object, not on the delegate!

          
          t=ui.TextField() 
          t.begin_editing()
          t.present()
          
          
          1 Reply Last reply Reply Quote 1
          • PetervdKamp
            PetervdKamp last edited by

            Thanks JonB, your solution did the trick. It didn't come to my mind to call it on the TextField object, because I was convinced that it should be called from the delegate. Kind of tunnel vision…..
            Thanks again.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors