Hi,
I have a wxTreeCtrl to which I am appending items. I cache the
str(wxTreeItemId) returned by the AppendItem of the wxTreeCtrl in a
dictionary as the key. On selection change, I retrieve the selection through
GetSelection method of the wxTreeCtrl. The wxTreeItemId returned by this
method is different from that returned while appending the same item. As a
result, when I do a lookup on the dictionary using the string of the
selected item as the key, i get a key not found exception. Is this the
correct behaviour?

My code is:

#while adding to the tree
parentNode = self.guiTree.AppendItem(self.root, 'name')
self.guiProxyHash[str(parentNode)] = keyvalue

#on selection changed to the root element
selection = self.guiTree.GetSelection()
selectedvalue = self.guiProxyHash[str(selection)]

The last line throws a key not found exception.

<<tech.gif>>

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to