I have a problem with ttk.Treeview in Python 3. If I try to insert item with values that contain newline, treeview crops item and shows only first line of text, instead of making multiline item. Is there any possibility to somehow configure treeview to show it? I would like to avoid implementing new class or add every new line as child item. I know that is it possible to edit Treeview style and for example set 'rowheight', but different items may have different number of newlines. Here is the example code:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
tv = ttk.Treeview(root, columns=['a','b'])
values = ['one', 'one \ntwo \nthree']
tv.insert('', 'end', values=values)
tv.insert('', 'end', values=values)
tv.pack()
To summary the question is: how to set different rowheight depends of number of newlines in item's values.