[英]Tkinter Treeview shows only first 3 columns
在程序啟動時; Tkinter Treeview 僅顯示 5 列的前 3 列。當您在標題中用鼠標指針稍微更改隨機列的寬度(幾個像素)時,釋放鼠標按鈕后所有列都會出現。
更新:選項displaycolumns="#all"
給出相同的結果。
hcolumns=('Hoofdstuk','Naam','Datum','Grootte','tafel')
tv=ttk.Treeview(mainframe, columns=hcolumns , show='headings', height=5)
for col in hcolumns:
tv.heading(col, text=col, command=lambda _col=col: treeview_sort_column(tv, _col, False))
tv.grid(column=0, row=0, sticky=(N,W,E,S))
添加width=<random number>
作為列選項就可以了。 所以你得到這個:
for col in hcolumns:
tv.heading(col, text=col, command=lambda _col=col: treeview_sort_column(tv, _col, False))
tv.column(col, width=0)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.