diff --git a/CHANGES.rst b/CHANGES.rst index f8fa3414..39189d8f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -130,6 +130,9 @@ Changes in this release include the following: * Use BufferedDC in Repaint() to mitigate flicker (wx.lib.agw.aui). (#686) +* Fixed crashing bug when using client data with items in + wx.dataview.DataViewTreeCtrl. (#856) + 4.0.1 "Lemonade" ---------------- diff --git a/etg/dataview.py b/etg/dataview.py index 2001776e..dfd5740a 100644 --- a/etg/dataview.py +++ b/etg/dataview.py @@ -11,7 +11,7 @@ import etgtools import etgtools.tweaker_tools as tools -from etgtools import PyFunctionDef, PyCodeDef, PyPropertyDef +from etgtools import PyFunctionDef, ParamDef PACKAGE = "wx" MODULE = "_dataview" @@ -538,14 +538,20 @@ def run(): #----------------------------------------------------------------- + def _setClientDataTrasfer(klass): + for item in klass.allItems(): + if isinstance(item, ParamDef) and item.type == 'wxClientData *': + item.transfer = True + c = module.find('wxDataViewTreeCtrl') tools.fixWindowClass(c) + _setClientDataTrasfer(c) c.find('GetStore').overloads = [] - c = module.find('wxDataViewTreeStore') c.addAutoProperties() tools.fixRefCountedClass(c) + _setClientDataTrasfer(c) #-----------------------------------------------------------------