Reputation: 11
How to set dynamically rowheight in Treeview widget of tkinter? I mean if I am adding wrapped text into the row then how can I set that particular row's height without affecting other rows' heights. Image 1 is the Treeview object created without selecting the row. When I select the row it cuts out the text I have inserted(Image 2).
Same thing happens if I insert a second row(Image 3), it cuts down to the rowheight I have mentioned in style.
Upvotes: 0
Views: 481
Reputation: 11
In a recent change what I have done in my program is to check for the length of the string passing to the Treeview. While filling Treeview with the rows set the 3 types of flags for 3 type of heights. Small, Medium and Large are set according to rows passing to the Treeview. Now, I have three flags to check for when I'm done with filling rows of Treeview. Checking from Small to Large, the highest flag set for my case is deciding factor for my all row heights for Treeview so I send according "rowheight" to Treeview.And that's all... I get all rows clear to be read, whenever I apply new changes.
For now this solution is serving for my project. But, still expecting to get individually settable rowheights for rows of Treeview.
Upvotes: 0