Tkinter Canvas 中的垂直文本 [英] Vertical text in Tkinter Canvas
本文介绍了Tkinter Canvas 中的垂直文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在 Tkinter 库中绘制垂直文本?(推荐Python)
Is there a way to draw vertical text in Tkinter library? (Python recommended)
textID = w1.create_text(5, 5, anchor="nw")
w1.itemconfig(textID, text = "This is some text")
推荐答案
由于人们已链接到此答案,我将添加更新.
Since people are being linked to this answer, I'll add an update.
在 tcl 8.6 中,create_text 方法有一个 angle
选项.您可以使用 Tkinter.TclVersion
检查您的 tcl 版本.如果您有 8.6 或更高版本,则可以使用:
In tcl 8.6, the create_text method got an angle
option. You can check your tcl version with Tkinter.TclVersion
. If you have 8.6 or greater, you can use:
textID = w1.create_text(5, 5, anchor="nw", angle=90)
这篇关于Tkinter Canvas 中的垂直文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文