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.


    Getting the current View

    Pythonista
    2
    3
    1896
    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.
    • ruimac
      ruimac last edited by

      I created a new View where I'm presenting several items (TextViews, Buttons, etc)
      I also created a routine for checking the values of some TextFields, that I attached to the action parameter of those text fields.
      The routine is called field_edit and its only parameter is (sender).
      However I would like to be able to create some new items in the view, inside that routine.
      How can I access the View, since the variable used to create it is in the main routine?
      Must I make it global? Or is any way to access the current view?

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

        You can get the sender.superview, which may already be your root view. If not, just continue navigating from there. Personally I always make my important views global to avoid this problem.

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

          Thank you for the information.
          I guess I will go the global way too.

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