wx.dataview.TreeListItemComparator¶
Class defining sort order for the items in wx.dataview.TreeListCtrl.
Added in version 2.9.3.
See also
Class Hierarchy¶
Methods Summary¶
Default constructor. |
|
Pure virtual function which must be overridden to define sort order. |
Class API¶
- class wx.dataview.TreeListItemComparator(object)¶
Possible constructors:
TreeListItemComparator() -> None
Class defining sort order for the items in TreeListCtrl.
Methods¶
- __init__(self)¶
Default constructor.
Notice that this class is not copiable, comparators are not passed by value.
- Return type:
None
- Compare(self, treelist, column, first, second)¶
Pure virtual function which must be overridden to define sort order.
The comparison function should return negative, null or positive value depending on whether the first item is less than, equal to or greater than the second one. The items should be compared using their values for the given column.
- Parameters:
treelist (wx.dataview.TreeListCtrl) – The control whose contents is being sorted.
column – The column of this control used for sorting.
first (wx.dataview.TreeListItem) – First item to compare.
second (wx.dataview.TreeListItem) – Second item to compare.
- Return type:
int
- Returns:
A negative value if the first item is less than (i.e. should appear above) the second one, zero if the two items are equal or a positive value if the first item is greater than (i.e. should appear below) the second one.