Merge pull request #620 from RobinD42/fix-issue595

Fix comparing TreeListItem __eq__ and __ne__
This commit is contained in:
Robin Dunn
2017-11-17 22:56:52 -06:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -54,6 +54,8 @@ Changes in this release include the following:
* Various fixes in UltimateListCtrl, HyperTreeList and CheckListCtrlMixin.
(#592, #349, #612)
* Fix comparing DataViewItem and TreeListItem objects with None. (#595)

View File

@@ -51,9 +51,10 @@ def run():
return (long)self->GetID();
""")
c.addCppMethod('bool', '__eq__', '(wxTreeListItem* other)', "return (self->GetID() == other->GetID());")
c.addCppMethod('bool', '__ne__', '(wxTreeListItem* other)', "return (self->GetID() != other->GetID());")
c.addCppMethod('bool', '__eq__', '(wxTreeListItem* other)',
"return other ? (self->GetID() == other->GetID()) : false;")
c.addCppMethod('bool', '__ne__', '(wxTreeListItem* other)',
"return other ? (self->GetID() != other->GetID()) : true;")
#-----------------------------------------------------------------
c = module.find('wxTreeListItemComparator')