Re: wxEuphoria: delete_tree_item() Not Working

new topic     » goto parent     » topic index » view thread      » older message » newer message

I think the documentation for delete_tree_item() is wrong. Here is the code for that function.

void WXEUAPI  delete_tree_item(intptr_t tree, object item) 
{ 
 
	//void Delete(const wxTreeItemId& item) 
	if( IS_SEQUENCE(item) ){ 
		int len = LENGTH( item ); 
		for( int i = 1; i <= len; i++) 
			((wxTreeCtrl *)tree)->Delete( wxTreeItemId( (void *) get_int( item, i ))); 
	} 
	else{ 
		((wxTreeCtrl *)tree)->Delete( wxTreeItemId( (void *) get_int( item ))); 
	} 
	wxDeRef( item ); 
} 

If item is a sequence, it will loop through that sequence deleting the items contained within. If item is not a sequence (i.e. an atom) then it will delete that one item.

If you want to clear a wxTreeCtrl, just delete the root item.

atom root = get_tree_root( tree ) 
delete_tree_item( tree, root )  

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu