如何在 ttk Treeview 小部件中将文本向右对齐? [英] How to align text to the right in ttk Treeview widget?
本文介绍了如何在 ttk Treeview 小部件中将文本向右对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 ttk.Treeview
小部件来显示阿拉伯语书籍列表.阿拉伯语是一种从右到左的语言,因此文本应向右对齐.可用于 Label
和其他 ttk
小部件的 justify 选项似乎不适用于 Treeview
.
I am using a ttk.Treeview
widget to display a list of Arabic books. Arabic is a right-to-left language, so the text should be aligned to the right.
The justify option that is available for Label
and other ttk
widgets does not seem to work for Treeview
.
有人知道怎么做吗?
推荐答案
ttk.Treeview
小部件有一个 anchor
选项,您可以为每列设置.要将列的锚点设置为右侧,请使用:
The ttk.Treeview
widget has an anchor
option you can set for each column. To set the anchor of a column to the right side use:
ttk.Treeview.column(column_id, anchor=Tkinter.E)
这篇关于如何在 ttk Treeview 小部件中将文本向右对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文