Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows progress bar in python's Tkinter

Is there any way in python's Tkinter, bwidget or anything similar to show a Windwos' default progress bar? I already know the bwidget.ProgressBar, but it produces an ugly progress bar while I mean showing a valid windows progress bar - the green, glowing one:

http://imageshack.us/photo/my-images/853/unledtph.png/

I need it because that way Windows will automatically show the progress of my program in the task bar. Plus, it looks better.

like image 806
speller Avatar asked Jun 18 '11 19:06

speller


2 Answers

If you are using a modern (2.7+) version of Tkinter you can try the ttk.ProgressBar which is part of Tkinter.

like image 71
Bryan Oakley Avatar answered Sep 25 '22 04:09

Bryan Oakley


You can install the pyttk module separately.

from Tkinter import *
import ttk
root = Tk()
progressbar = ttk.Progressbar(orient=HORIZONTAL, length=200, mode='determinate')
progressbar.pack(side="bottom")
progressbar.start()
root.mainloop()

As far as the taskbar functionality, that is not available in Tkinter yet (at least to the best of my knowledge). You'll need to make use of the Windows API for that. Although this question is for PyQt, the answers should prove helpful. Hope it gets you started.

like image 32
Bryan Avatar answered Sep 24 '22 04:09

Bryan