【问题标题】:python tkinter: Progressbar indeterminate: mac os: how to oncrease the size of the bright area movingpython tkinter: Progress Bar indeterminate: macos: 如何增加移动亮区的大小
【发布时间】:2020-06-12 21:38:59
【问题描述】:

我有一个不确定的进度条,问题是当它开始运行时,我几乎没有注意到它实际上正在做任何事情。 我注意到本机 mac os 应用程序上的明亮区域更大,或者更快,所以当它移动时,它很明显。

我可以修改运动部件的颜色/速度吗?

self.progressbar_Progress = ttk.Progressbar(frame_Output)
    self.progressbar_Progress.config(maximum='1', mode='indeterminate', orient='horizontal', value='0')
    self.progressbar_Progress.pack(anchor='w', expand='true', fill='x', padx='0', side='top')
self.progressbar_Progress.start()

【问题讨论】:

标签: python tkinter


【解决方案1】:

进度条出现奇怪的原因是因为您将起始值设置为 0,但随后将 maximum 设置为 1。由于它只需要走1,它会闪烁,因为它没有距离可以走。

这根本不是 Mac OS 原生的;它也发生在窗户上。为了解决这个问题,我将maximum 设置为 100。

这是最终代码:

import ttkthemes as ttk

from tkinter import *

frame_Output = Tk()
p = ttk.Progressbar(frame_Output)
p.config(maximum='100', mode='indeterminate', orient='horizontal', value='0')
p.pack(anchor='w', expand='true', fill='x', padx='0', side='top')
p.start()

frame_Output.mainloop()

希望这会有所帮助!

【讨论】:

  • 不幸的是,结果仍然相同。完全没有变化。
猜你喜欢
  • 2018-02-26
  • 2015-06-10
  • 2016-04-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多