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.


    Outliner with drag/drop reordering - part 2

    Pythonista
    9
    594
    284124
    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.
    • cvp
      cvp @ihf last edited by

      @ihf One of the usual Pythonista crashes for which, I think, my script is not responsible. I'm sorry for you and I would understand that you stop to use this program. It uses almost all internal functionalites of Pythonista, is big, uses a lot of memory, and crashes too much in not reproducible ways.

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

        @cvp I can live with occasional crashes. (Just wish that @omz would reappear or let someone have the source to Pythonista). In any case, does the sort order look right to you?

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

          @ihf did

          yes the display I posted is after hitting the sort button

          I don't think so, the sort button changes from πŸ”½ to πŸ”Ό after you to it.

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

            @cvp yes, it cycles thru up, down, and numeric.

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

              @ihf yes, but the image you posted shows the button as πŸ”½, that will say the next tap will give a descending sort, actual is no sort

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

                @cvp OK, so the button that shows is not the way it is sorted, but how it would be sorted if you hit the button? Not what I would have expected. However this has just surfaced a different bug. I went back and hit Expand All and the top line of icons is (mostly) gone.

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

                  @cvp but the sort does work (once I realize that the button is showing what will be not what is).

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

                    @cvp it happened a few times, but now I can't reproduce it reliably so I guess it is not worth spending time on.

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

                      @ihf said

                      the sort does work (once I realize that the button is showing what will be not what is).

                      Do you prefer that it should show what the sort is?

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

                        @cvp Yes, I would prefer that but now that I know what it is, I could live with it.

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

                          @ihf V01.23 and outline.versions with

                          Version V01.23
                            - icon of dates sort button now shows the actual sort order, not the order if
                              button would be tapped
                          
                          1 Reply Last reply Reply Quote 0
                          • ihf
                            ihf last edited by

                            @cvp If my outline is collapsed and I select view by completion date, and then select sort button to change to sort down, the display gets messed up in that lines are overlapping.

                            cvp 3 Replies Last reply Reply Quote 0
                            • cvp
                              cvp @ihf last edited by

                              @ihf

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

                                @ihf said

                                If my outline is collapsed and I select view by completion date, and then select sort button to change to sort down, the display gets messed up in that lines are overlapping.

                                It seems that lines after sort keep height of initial order, I don't understand why because I recompute their height in tableview_cell_for_row delegate

                                Γ‰dit: but I guess that ObjectiveC code of TableView also calls it again. Very annoying.

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

                                  @cvp I am glad to see that you are maintaining a sense of humor. (or at least I hope you are).

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

                                    @ihf said

                                    or at least I hope you are

                                    I also hope it is humor, not instinct

                                    Obviously, I should have to advice: don't collapse, don't sort, don't.....

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

                                      @ihf Version mac_outline_viewer.py V00.04 with

                                        V0.04
                                          - use a dropdown selector to choose which dates to show
                                      

                                      Thanks to you, I have had to use my poor JavaScript and HTML5
                                      Feed-back hoped

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

                                        @cvp I wonder if updates are not being made on the main thread...
                                        https://stackoverflow.com/questions/2318445/uitableview-crashes-if-data-source-is-updated-during-scrolling

                                        You can try beginUpdates() before updating your data (adding or deleting rows) then end updates() after reloading on the tableview ObjCInstance)

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

                                          @JonB thanks for your continuous help. I remember that I already did something like that, without success.
                                          I would try to incorporate this advice but it not so easy, and obviously no way to correctly test it because the problem is not reproducible on demand.

                                          Don't forget that the way I update the TableView is only by modifying directly the items, wiThouT calling delete or add functions. There are a lot of script lines where I update items because there are a lot of ways to do it. And often, the call reload_data is not in the same function. Very annoying to update in your adviced way.

                                          I have tried this beginUpdates before deleting item(s) and enUpdates() after reload_dara, and I get this ObjectiveC error (I remember now I already got it and stopped to use this code)

                                          Invalid update: invalid number of rows in section 0. 
                                          The number of rows contained in an existing section after the update (56)
                                           must be equal to the number of rows contained in that section before the update (60), 
                                          plus or minus the number of rows inserted or deleted from that section (0 inserted, 
                                          0 deleted)
                                           and plus or minus the number of rows moved into or out of that section (0 moved in, 
                                          0 moved out). Table view: <SUITableView_PY3: 0x14233d000; baseClass = UITableView; 
                                          frame =(0 74; 818 1106); 
                                          clipsToBounds = YES; gestureRecognizers = <NSArray: 0x286c94480>; layer = <CALayer: 0x283c27a00>; contentOffset: {0, 373.5}; contentSize: {818, 2492};
                                           adjustedContentInset: {0, 0, 20, 0}; dataSource: <SUITableView_PY3: 0x14233d000; 
                                          baseClass = UITableView; frame = (0 74; 818 1106); clipsToBounds = YES;
                                           gestureRecognizers = <NSArray: 0x286c94480>; layer = <CALayer: 0x283c27a00>; 
                                          contentOffset: {0, 373.5}; contentSize: {818, 2492}; adjustedContentInset: {0, 0, 20, 0};
                                           dataSource: <SUITableView_PY3: 0x14233d000>>>
                                          

                                          Perhaps due that to delete a row and its children, I rebuild the data_source.items before reload the TableView, without using any call to an eventUal delete function. And, that works always for me, I never have this crash posted by @ihf.

                                          I think next time I write such a program (if ever) I will use a basic scroll view and draw all the necessary objects myself ...

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

                                            @ihf V01.24 and outline.versions with

                                            Version V01.24
                                                - correction of bug "sometimes after view dates, back and hit Expand All
                                                and the top line of icons is (mostly) gone"
                                            
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors