Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在python的tkinter中,如何在messagebox中放置进度条?_Python_User Interface_Tkinter - Fatal编程技术网

在python的tkinter中,如何在messagebox中放置进度条?

在python的tkinter中,如何在messagebox中放置进度条?,python,user-interface,tkinter,Python,User Interface,Tkinter,我试图在消息框中放置一个进度条,以显示文件下载的进度;大概是这样的: (图片取自) 因此,对于进度条,我将使用以下内容: pbar=ttk.Progressbar(app,orient='horizontal',length=200,mode='determinate') pbar.pack() 也许我可以使用一个文本小部件,但我不太确定如何使这个新窗口出现。我写过这样的东西吗 root1=Tk() root1.title("Status Dialog") pbar=ttk.Progress

我试图在消息框中放置一个进度条,以显示文件下载的进度;大概是这样的:

(图片取自)

因此,对于进度条,我将使用以下内容:

pbar=ttk.Progressbar(app,orient='horizontal',length=200,mode='determinate')
pbar.pack()
也许我可以使用一个文本小部件,但我不太确定如何使这个新窗口出现。我写过这样的东西吗

root1=Tk()
root1.title("Status Dialog")
pbar=ttk.Progressbar(app,orient='horizontal',length=200,mode='determinate')
pbar.pack()

root1.mainloop()

有什么想法吗?

我想你有一个错误:在你的代码中,
pbar=ttk.ProgressBar(app,…)
应该被
pbar=ttk.ProgressBar(root1,…)
取代。在这个类实例化中,第一个参数是父小部件,我打赌它应该是代码中的
root1


但正如brc在评论中所写,我们不能确定,只要您不描述您的错误(例如,给我们回溯)。

找到图像的页面包含源代码。看看吧。