Hello,
I'm using wxPython first time in my life and I'm new in Python too.. I have two questions about TreeCtrl:
1) Is there any method which returns list of node's children? I'm using 'for' statement and getNextChild() but it doesn't seem nice to me.
2) If i call CollapseAllChildren(item) method will it rise wx.EVT_TREE_ITEM_COLLAPSED event on every collapsed node under 'item' node?
Thank you in advice.
···
--
Gabriel
Hi Gabriel,
Hello,
I'm using wxPython first time in my life and I'm new in Python too.. I have
two questions about TreeCtrl:
1) Is there any method which returns list of node's children? I'm using
'for' statement and getNextChild() but it doesn't seem nice to me.
Not directly, but you can use the 2 methods GetFirstChild/GetNextChild
like this:
item, cookie = tree.GetFirstChild(parentItem)
while item.IsOk():
item, cookie = tree.GetFirstChild(parentItem, cookie)
2) If i call CollapseAllChildren(item) method will it rise
wx.EVT_TREE_ITEM_COLLAPSED event on every collapsed node under 'item' node?
No, at least not on Windows XP, not sure about the other platforms.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
···
On Fri, Apr 17, 2009 at 1:07 PM, Gabriel wrote:
Robin
3
Andrea Gavana wrote:
Hi Gabriel,
Hello,
I'm using wxPython first time in my life and I'm new in Python too.. I have
two questions about TreeCtrl:
1) Is there any method which returns list of node's children? I'm using
'for' statement and getNextChild() but it doesn't seem nice to me.
Not directly, but you can use the 2 methods GetFirstChild/GetNextChild
like this:
item, cookie = tree.GetFirstChild(parentItem)
while item.IsOk():
item, cookie = tree.GetFirstChild(parentItem, cookie)
And it would be simple to put that in a generator function and then you could do normal pythonic iteration over the collection of child nodes.
···
On Fri, Apr 17, 2009 at 1:07 PM, Gabriel wrote:
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
No, at least not on Windows XP, not sure about the other platforms.
Andrea.
And can I raise this event for all items which will be collapsed after calling CollapseAllChildren()?
Thanks for response, btw .)
···
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
--
Gabriel