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.


    Load webview url

    Pythonista
    3
    8
    3334
    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.
    • donnieh
      donnieh last edited by

      Newbie here. Why won't this load? I have a webview placed in the UI.

      import ui

      w1 = ui.WebView('webview1')
      w1.load_url('http://www.yahoo.com')

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

        You have to add the WebView to a View as a subview and present it.

        w1 = ui.WebView('webview1')

        w1.load_url('http://www.yahoo.com')

        my_view = ui.View()

        my_view.add_subview(w1)

        my_view.present()

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

          You can also directly present the WebView:

          import ui
          w1 = ui.WebView('webview1')
          w1.load_url('http://www.yahoo.com')
          w1.present()
          
          1 Reply Last reply Reply Quote 0
          • donnieh
            donnieh last edited by

            Thank you all very much. The web view works good, especially with CCC's suggestion. However the results are not as expected. These above examples creates a pop up web view which is not intended. I have a web view library object placed in the .pyui editor. It is named webview1. How do I open a url in this little web view and not the pop up full screen web view?

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

              w1.present('sheet')

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

                Hmmm

                w1.present('sheet')

                and

                w1.present( )

                both identically open the sheet web view. Neither open the webview I placed in the .pyui editor from the library (webview1).

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

                  import ui
                  view = ui.load_view()
                  w1 = view['webview1']
                  w1.load_url('http://www.yahoo.com')
                  view.present()
                  
                  1 Reply Last reply Reply Quote 0
                  • donnieh
                    donnieh last edited by

                    Works like a charm! Thank you!!!!!

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