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.


    Print Console in TextView or ScrollView

    Pythonista
    5
    15
    11166
    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.
    • starrshaw
      starrshaw last edited by

      Thanks guys! Both these ideas worked great!

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

        Hi, I’m also a novice trying to make a UI for a text-y thing I started on in the console: https://github.com/weevil/adventurers_guild
        Doesn’t PyUI depend on pygame to work? Doesn’t that make it unusable with Pythonista?

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

          @wiley The ui module is based on the iOS UIKit framework, it has nothing to do with pygame. It's also specific to Pythonista, there's no way to use it on regular computers, since the underlying framework only exists on iOS.

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

            Thank you!

            Is there a comparable simple ui module that works both in and out of pythonista? I had looked at pyglet but it requires pygame. I'd like to be able to work in pythonista but still have the program run elsewhere. I only need a very minimal UI... basically just a box to dump text in and a button or two to refresh it.

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

              @wiley There is a library called UniPAGe that provides a common API for Pythonista's ui module and the Kivy library. I haven't really used it myself, but it seems like the sort of library you're looking for.

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

                I had to use a more portable ui module like I mentioned but I’m playing with pythonista‘ ui module and it’s really great! I can’t believe it’s got its own graphical editor. Is there a code example somewhere on how to populate the scroll view element? I’m not sure how to get output into it.

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

                  https://github.com/humberry/ui-tutorial

                  1 Reply Last reply Reply Quote 1
                  • wiley
                    wiley last edited by

                    Even in the scrollview example in there I don't see an attribute for like, .text or .content... what am I missing?

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

                      Scrollviews are just container views that contain subviews.
                      You use add_subview to add stuff to a scroll view (usually will be a single view that is larger than the scrollview.
                      You then use content_size to set the scrollable region -- usually would be the size of your subview. When content_size is larger than the scrollview frame, it will allow scrolling.

                      Note that both TableView and TextView are actually subclasses of ScrollView, so if you are just doing tabular or textual work, you don't need scrollview per se, but can still implement some of the delegate methods.

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

                        Ah! Thank you!

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