amiga-mui / muidev

:mage_man: Magic User Interface (MUI) – Documentation+Releases

Home Page:http://muidev.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

And another sort problem

afalkenhahn opened this issue · comments

The listview sort stuff seems to be really buggy. Here's another one: Start the attached program, click the second column's header. It will make the second column the sort column and the header will correctly show the ascending arrow. However, the items in column 2 will NOT be sorted in ascending order! They will be sorted in descending order instead!

Next problem: After doing the steps described above, click the second column's header again. Now the items will appear in the correct order (i.e. ascending) but of course this behaviour is also wrong because since the column header has been clicked a second time, the sort order should now be set to descending instead of keeping ascending sort order.
main.txt

This works for me. I modified the List2 demo accordingly and changing the sort column correctly applies the descending sort order (see attached modified List2 demo: list2.txt)

Why are you setting attributes of List class on an object of Listview class? This works, yes, but it is inefficient. Listview class will forward unknown attributes to its parent class (Group class) which then in turn delegates the attributes to all of its child objects, including the embedded List object. This makes things more complicated then necessary.

All the attributes you set are clearly named MUIA_List_XXX instead of MUIA_Listview_XXX. So why taking the expensive detour?

This works for me. I modified the List2 demo accordingly and changing the sort column correctly applies the descending sort order (see attached modified List2 demo: list2.txt)

Um, have you read my bug report? This is not about changing the sort column by setting MUIA_List_SortColumn but it's about changing the sort column by clicking on the header and that is still broken with today's nightly. All the things I described in the OP are still broken so please carefully read my bug report again and execute the steps I described to see the problem.

Why are you setting attributes of List class on an object of Listview class?

That line is just some leftover from some previous test code quickly hacked together. It's completely unrelated to this bug report. Please read my original report again.

Ok, I see. Changing the current sort column indeed does change the column, but until now the new column's (remembered) sort order was not applied. This will be fixed in the next nightly build.