Search code examples
imagewxpythontreecontrol

Remove image from treectrl items


I add images to wxpython treectrl items with tree.SetItemImage. Later the image shall be removed. How can I do it? I found only the SetItemImage method, I have not found anything like RemoveItemImage.


Solution

  • It's not very obvious, but you can remove the item's image by calling SetItemImage and passing -1 through for the image parameter

    tree.SetItemImage(node, -1)