From: Andrea Gavana [mailto:andrea.gavana@gmail.com]
Sent: Wednesday, January 09, 2008 4:27 PM> > From: Andrea Gavana [mailto:andrea.gavana@gmail.com]
> > Sent: Wednesday, January 09, 2008 4:02 PM
> >
> > > Is there any size limitation of wx.lib.customtreectrl?
> >
> > SetPyData). I did some testing some month ago (adding 1800 items) on
>
> How big was the item data, and total text size?No item data for both the trees, and the texts were just artist names
and song names from my mp3 collection.
Ah. OP, are you loading 7MB items or item data?
> Missed the suggestion. Was it to use SetItemData with a key into a
> dictionary? How about a shelf?
If the former, Mr. Robin sounds right, but it's a pain. If the latter, how
does mine sound (and how anyway)?
Which is the way to go even with the native wx.TreeCtrl when the
number of items is very high or unknown (such in a Windows Explorer
directory tree, for example, which is the way wx.GenericDirCtrl is
implemented as far as I remember).
- Case: Many small [cf. Dunn]:
@binddec( tree, wx.EVT_TREE_ITEM_EXPANDED )
def onexpanded( event ):
item= event.GetItem()
look up item in data
for child in its children:
chitem= tree.AddItem( item, your data )
if child has children:
SetItemHasChildren( chitem [, True?] )
- Case: Some large [cf. Brady], such as pictures, sounds, &c.:
for datum in your data:
shelf[datum.key]= datum.value
datumitem= tree.AddItem( where, datum.key )
tree.SetItemData( datumitem, datum.key )
@binddec( tree, wx.EVT_TREE_SEL_CHANGED )
def onselchange( event ):
item= event.GetItem()
datumkey= tree.GetItemData( item )
datum= shelf[datumkey]
do what with datum
ยทยทยท
-----Original Message-----
On Jan 9, 2008 11:20 PM, Aaron Brady wrote:
> > -----Original Message-----