2.5 segfault

Hello,
wxWindows GTK2 2.5 (CVS of 2004-01-12 - sorry can't get a more recent
copy at the moment):

Python 2.3.3 (#1, Jan 15 2004, 19:25:13)
[GCC 3.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import wx
app = wx.PySimpleApp()
f = wx.Frame(None, -1, "")
tree = wx.TreeCtrl(f, -1)
r = tree.AddRoot("root")
items = [tree.AppendItem(r, "item %d" % i) for i in range(10)]
items

[<wx.controls.TreeItemId; proxy of C++ wxTreeItemId instance at
_a8003208_p_wxTreeItemId>, <wx.controls.TreeItemId; proxy of C++
wxTreeItemId instance at _88023208_p_wxTreeItemId>,
<wx.controls.TreeItemId; proxy of C++ wxTreeItemId instance at
_b8f93108_p_wxTreeItemId>, <wx.controls.TreeItemId; proxy of C++
wxTreeItemId instance at _b0f83108_p_wxTreeItemId>,
<wx.controls.TreeItemId; proxy of C++ wxTreeItemId instance at
_38f93108_p_wxTreeItemId>, <wx.controls.TreeItemId; proxy of C++
wxTreeItemId instance at _a8f53108_p_wxTreeItemId>,
<wx.controls.TreeItemId; proxy of C++ wxTreeItemId instance at
_58013208_p_wxTreeItemId>, <wx.controls.TreeItemId; proxy of C++
wxTreeItemId instance at _68013208_p_wxTreeItemId>,
<wx.controls.TreeItemId; proxy of C++ wxTreeItemId instance at
_38003208_p_wxTreeItemId>, <wx.controls.TreeItemId; proxy of C++
wxTreeItemId instance at _48003208_p_wxTreeItemId>]

i, cookie = tree.GetFirstChild(r)
i

<wx.controls.TreeItemId; proxy of C++ wxTreeItemId instance at
_f4f2ffbf_p_wxTreeItemId>

i.m_pItem

'_28000000_wxTreeItemIdValue'

items[0].m_pItem

'_70003208_wxTreeItemIdValue'

tree.GetItemText(items[0])

'item 0'

tree.GetItemText(i)

Segmentation fault

So, what's going on here? From my investigations, it seems that
wxPyConstructObject(&ritem, wxT("wxTreeItemId"), True)
(controls_wrap.cpp around line 670, in wxPyTreeCtrl_GetFirstChild)
somewhat messes up the value of m_pItem (you can watch this by putting a
   printf("ritem.m_pItem = %p\n", ritem.m_pItem); just before it, and see
that at that time the value is still correct). I don't know why though,
and definitely have too little (almost zero) knowledge of swig to find
out more...

Alberto

Alberto Griggio wrote:

Hello,
wxWindows GTK2 2.5 (CVS of 2004-01-12 - sorry can't get a more recent
copy at the moment):

[...]

'item 0'

tree.GetItemText(i)

Segmentation fault

So, what's going on here?

I'll look into this today. Thanks for all the info.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Alberto Griggio wrote:

Hello,
wxWindows GTK2 2.5 (CVS of 2004-01-12 - sorry can't get a more recent
copy at the moment):

[...]

'item 0'

tree.GetItemText(i)

Segmentation fault

So, what's going on here?

I'll look into this today. Thanks for all the info.

This is now fixed in CVS.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!