Tkinter ttk.Progressbar: 如何更改进度条的图形化 length/width?

Tkinter ttk.Progressbar: How to change the graphical length/width of the progress bar?

所以我在弄乱 ttk 中的进度条,但我想知道如何更改它的长度。不是它长度的数值,而是进度条的实际视觉长度。

对于其他小部件,我只想 'width=27' 或其他任何方式进行更改,但它似乎不起作用。

有什么想法吗?谢谢。

根据评论总结:

    与大多数小部件不同,
  • ttk.Progressbar 没有 width 选项,但它有 length 选项。

  • 不要将length混淆为进度条的最大值,它只是进度条的宽度(默认以像素为单位)。

  • 可以使用maximum选项设置进度条的最大值。

  • 要获取小部件接受的属性列表,您可以使用 <Widget>().keys() 或者如果您想详细查看 ~ <Widget>.__init__.__docs__ 将 return 小部件的文档字符串__init__(正如 TheLizzard 所说)。

ttk.Progressbar(root, length=200, maximum=300) # 200 pixels wide and 300 is maximum value