Phoenix: CustomTreeCtrl::SortChildren doesn't work

42 views
Skip to first unread message

Tiziano Tissino

unread,
Sep 3, 2013, 1:19:30 PM9/3/13
to wxpytho...@googlegroups.com
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.

Thomas

unread,
Jul 19, 2017, 9:51:43 AM7/19/17
to wxpytho...@googlegroups.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

Thomas

unread,
Jul 19, 2017, 10:19:26 AM7/19/17
to wxpytho...@googlegroups.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
Reply all
Reply to author
Forward
0 new messages