#tree is an instance of wxTreeCtrl
tree.AppendItem(None, "foo")
(The idea of the above was to append a new top-level item, something which
the Windows treeview allows, though I see now that it is not allowed by the
wxWindows tree control. Since it is not allowed, it should produce a Python
exception, not an access violation.)
After looking at the source, it is evident that the access violation comes
about because the SWIG wrapper converts the None (which represents the
parent itemid) into a NULL wxTreeItemID *. The wrapper then dereferences
and passes this NULL pointer to wxTreeCtrl::AppendItem, which requires a
wxTreeItemId&. Eventually, the code attempts to use this reference, which
results in an access violation.
It seems to me that SWIG wrappers should detect cases where they have a NULL
pointer to pass as a parameter which is typed as a C++ reference; in those
cases, a Python exception should be generated by the wrapper.
Unfortunately, I've never used SWIG, so I'm not sure exactly how to go about
making such a change. Perhaps someone else has a suggestion.
Greg Chapman
_______________________________________________
wxPython-users mailing list
wxPytho...@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users