Hello Toni & NG,
So how to find out the heigt of a treeitem?
Well, I don't know how and why, but by doing this in the buildVisibleRows() method:
self.SetDefaultRowSize(self.tree.GetBoundingRect(self.tree.GetRootItem()).GetHeight()-1)
I managed to make it *almost* working (to me it works, but it's better that you check that instruction and see if it works reasonably well also for you). I am surely wrong but, your instruction:
self.SetDefaultRowSize(self.tree.GetBoundingRect(self.tree.GetRootItem()).GetHeight())
Is perfect as long as you don't consider the width of the line that separate two adjacent rows. In my view, this line is 1 pixel width, and for that I subtract 1 to GetHeight(). I have also tried to change the wx.TreeCtrl font size (I made it 12 pointsize) and it still works... for the very limited tests I have made, it works. You may try to change something else and see if it suits your needs.
HTH.
Andrea.
···
_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London
Direct Tel: +44 (0) 20 717 08942
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯