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.


    The performance of button.name is kind of slow?

    Pythonista
    3
    61
    20817
    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.
    • ?
      A Former User @cvp last edited by

      @cvp I can use telegram to chat, if you often uses it too.

      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @Guest last edited by

        @lpl Sorry but it seems a little bit big to really be able to help.
        When you scroll your indexes, the script has to update the images in the buttons, thus it takes some time and if you scroll to quickly, has not enough time to refresh the images?
        Your white parts happen when you scroll quickly?

        ? 2 Replies Last reply Reply Quote 0
        • ?
          A Former User @cvp last edited by

          @cvp I use several Labels or Buttons as the subviews of ScrollView. When we scroll, if one subview is hidden(can't be seen by users), then we can move the subview from the top side to the other side.

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User @cvp last edited by

            @cvp And yes, when I scroll quickly, the white part shows. But just for Buttons, not Labels or ImageViews. So I think the performance of Button.title is not good.

            cvp 2 Replies Last reply Reply Quote 0
            • cvp
              cvp @Guest last edited by

              @lpl I don't think the title is the reason.
              I have import d your code but when I try to run it, I have an error on

              Import toml
              

              Toml Not found

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @Guest last edited by

                @lpl try your buttons without image, just to check

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @cvp last edited by

                  @cvp pip install toml I used toml module in my code. Should write a requirement file.

                  1 Reply Last reply Reply Quote 0
                  • cvp
                    cvp @cvp last edited by

                    @cvp one question: when you have to display a new index, do you need to get data from internet? If yes, that could explain why it is slower

                    ? cvp 2 Replies Last reply Reply Quote 0
                    • ?
                      A Former User @cvp last edited by

                      @cvp No, I loaded all and then I display them.

                      1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @cvp last edited by

                        @lpl toml loaded, crash

                        Traceback (most recent call last):
                          File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/ebook_reader.py", line 27, in <module>
                            controller = Controller(EBookLoader, EBookReader)
                          File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/controller.py", line 17, in __init__
                            self.reader_viewer = ReaderViewer(self)
                          File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/ereader.py", line 55, in __init__
                            super().__init__(EBookBodyViewer, controller)
                          File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/ereader.py", line 9, in __init__
                            self.var_index_viewer = IndexViewer(self)
                          File "/private/var/mobile/Containers/Shared/AppGroup/668A7D98-7216-47ED-917D-AA0B6173167E/Pythonista3/Documents/yj_ebook_reader-master/yj_ebook_reader-master/index_viewer/index_viewer.py", line 12, in __init__
                            reader_view = ui.load_view('index_viewer/index')
                          File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 412, in load_view
                            return load_view_str(json_str, bindings, stackframe, verbose=verbose)
                          File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 398, in load_view_str
                            return _view_from_dict(root_view_dict, g, l, verbose=verbose)
                          File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 379, in _view_from_dict
                            subview = _view_from_dict(d, f_globals, f_locals, verbose=verbose)
                          File "/var/containers/Bundle/Application/E4751F4F-64A4-4BE6-AB9D-9C9564715002/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/ui.py", line 321, in _view_from_dict
                            _bind_action(v, attrs.get('action'), f_globals, f_locals, verbose=verbose)
                        TypeError: my_bind_action() got an unexpected keyword argument 'verbose'
                        
                        ? 1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @cvp last edited by A Former User

                          @cvp Maybe you changed some parts of the code? I'm sure there is no such serious bug.

                          cvp 2 Replies Last reply Reply Quote 0
                          • cvp
                            cvp @Guest last edited by

                            @lpl no change at all, but I have the new Pythonista beta...

                            ? 1 Reply Last reply Reply Quote 0
                            • cvp
                              cvp @Guest last edited by

                              @lpl could you tell me where is the code which is executed when you scroll your indexes

                              ? 1 Reply Last reply Reply Quote 0
                              • ?
                                A Former User @cvp last edited by

                                @cvp I'm using the beta too. And I shared the code to my friends. No such issues before… so strange

                                1 Reply Last reply Reply Quote 0
                                • ?
                                  A Former User @cvp last edited by

                                  @cvp https://github.com/yjqiang/yj_ebook_reader/blob/master/index_viewer/index_viewer.py#L107

                                  cvp 1 Reply Last reply Reply Quote 0
                                  • cvp
                                    cvp @Guest last edited by

                                    @lpl sure your req_data does not access internet?

                                    Is it possible to replace your buttons by labels, title->text, only for scrolling, not for clicking, just to see if speed better?

                                    ? 1 Reply Last reply Reply Quote 0
                                    • ?
                                      A Former User @cvp last edited by

                                      @cvp Did you notice "bg"? This means backgroud, and it just send requests. And I use load_data to load the result into view.

                                      cvp 1 Reply Last reply Reply Quote 0
                                      • cvp
                                        cvp @Guest last edited by

                                        @lpl ok, sorry
                                        Do you think it is possible to replace buttons by labels if you don't tap them?

                                        ? 1 Reply Last reply Reply Quote 0
                                        • ?
                                          A Former User @cvp last edited by

                                          @cvp I compared before, and no white parts with Label.

                                          cvp 2 Replies Last reply Reply Quote 0
                                          • cvp
                                            cvp @Guest last edited by

                                            @lpl First, I restarted Pythonista and the error disappears, it was in module ui.py???

                                            Could you try to comment the line where you set dynamically the action of the button

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