On Tuesday 30 September 2008 03:45:30 pm Mike Mabey wrote:
> Hi there,
>
> I'm trying to populate a dTreeView with treeFromStructure(), but I keep
> getting this:
>
> Traceback (most recent call last):
>   File "dialogs.py", line 25, in <module>
>     app.start()
>   File "C:\src\dabo\dApp.py", line 315, in start
>     self.setup()
>   File "C:\src\dabo\dApp.py", line 280, in setup
>     self.initUIApp()
>   File "C:\src\dabo\dApp.py", line 307, in initUIApp
>     self.uiApp.setup()
>   File "C:\src\dabo\ui\uiwx\uiApp.py", line 302, in setup
>     frm = self.dApp.MainForm = dabo.ui.createForm(mfc)
>   File "C:\src\dabo\ui\uiwx\__init__.py", line 1124, in createForm
>     frm = cls(*args, **kwargs)
>   File "c:\docume~1\mike\locals~1\temp\tmp9efwxz.py", line 53, in __init__
>     obj = self.getCustControlClass('dTreeView_1773125380')(currParent)
>   File "c:\docume~1\mike\locals~1\temp\tmp9efwxz.py", line 236, in __init__
>     dabo.ui.dTreeView.__init__(self, parent=parent,
> attProperties=attProperties, *args, **kwargs)
>   File "C:\src\dabo\ui\uiwx\dTreeView.py", line 414, in __init__
>     *args, **kwargs)
>   File "C:\src\dabo\ui\uiwx\dPemMixin.py", line 86, in __init__
>     self._initProperties()
>   File "C:\src\dabo\dObject.py", line 177, in _initProperties
>     self.initProperties()
>   File "c:\docume~1\mike\locals~1\temp\tmp9efwxz.py", line 251, in
> initProperties
>     self.treeFromStructure(["Part Categories",[None]])
>   File "C:\src\dabo\ui\uiwx\dTreeView.py", line 939, in treeFromStructure
>     self.DeleteAllItems()
>   File "C:\Python25\lib\site-packages\wx-2.8-msw-ansi\wx\_controls.py",
> line 5433, in DeleteAllItems
>     return _controls_.TreeCtrl_DeleteAllItems(*args, **kwargs)
> TypeError: in method 'TreeCtrl_DeleteAllItems', expected argument 1 of type
> 'wxPyTreeCtrl *'
>
>
> I don't know if I'm just not using treeFromStructure correctly, or if
> there's something else I'm missing.  I'm calling this method in the tree's
> initProperties() method.  I've tried several different combinations of the
> parameters, including:
>
> self.treeFromStructure(["Root Title"])
> self.treeFromStructure(["Root Title", [None]])
> self.treeFromStructure(["Root Title", ["First Child"]])
> self.treeFromStructure(["Root Title", [["First Child"]]])
>
> You get the idea.  What am I doing wrong?
>
> Thanks,
> Mike M.

Not sure what you are doing with your nodes so I'm going to point you to the 
actual control "dTreeView.py".  Run  "dTreeView.py" and then take a look at 
the code.  Pay close attendion to "addDummyData".  Also I would add my tree 
in "afterInit" of the form.  And take note that self.treeFromStructure() is 
looking for a list like:
['This is the root', [['First Child'], ['Second Child', [['Grandkid #1'], 
['Grandkid #2', ['Great-Grandkid #1']], ['Grandkid #3']]], ['Third Child']]]

-- 
John Fabiani


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to