Phoenix: CustomTreeCtrl::SortChildren doesn't work

Hi,

I'm just trying to port my wxPython applications to Phoenix and I got a
couple of bugs in the CustomTreeCtrl::SortChildren method.

First, it uses six.sort method, that's undefinited in six module
Second, it uses a compare method (defaulting to
CustomTreeCtrl.OnCompareItems) to sort children, instead of using a key
function. This way, it will not work under python 3.x

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Phoenix-CustomTreeCtrl-SortChildren-doesn-t-work-tp5718499.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Hi,

this issues are not resolved in wxpython 4!

Thomas

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Phoenix-CustomTreeCtrl-SortChildren-doesn-t-work-tp5718499p5727426.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Possible patch:

-children = six.sort(children, self.OnCompareItems)
+from functools import cmp_to_key
+sorted(children, key=cmp_to_key(self.OnCompareItems))

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Phoenix-CustomTreeCtrl-SortChildren-doesn-t-work-tp5718499p5727427.html
Sent from the wxPython-users mailing list archive at Nabble.com.