7

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.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
speller
  • 1,641
  • 2
  • 20
  • 27

3 Answers3

10

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

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
8

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.

Community
  • 1
  • 1
Bryan
  • 6,529
  • 2
  • 29
  • 16
0

The simplest solution would appear to be to use themed Tk with the tkinter.ttk module included in Python 2.7 and 3.1. The Progressbar widget is what you want.

Since you appear to be considering other frameworks you might look at Qt or wxWidgets which look native and have excellent Python bindings.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • The Problem is I already have a full up-and-running application that uses Tkinter - All I want to do is add a prog. bar to it. If I wanted to know what python module should I use for GUI programming - I would have asked that very question. – speller Jun 18 '11 at 20:15
  • @speller Both answers point you to tkinter.ttk. You also started your question "Is there any way in python's Tkinter, bwidget or anything similar" which I took to mean that the answer was not restricted to Tkinter. Anyway, Bryan has put me right and it does indeed seem that modern Tkinter is much better. – David Heffernan Jun 18 '11 at 20:17
  • The title clearly says "python's Tkinter". bwidget works with Tkinter and only comes to add features to it, but I'm sorry if I wasn't clear. Anyway - I understand that you both don't know any way to do it with 2.6's Tkinter - so thnx :) – speller Jun 18 '11 at 20:23
  • @speller I'm only trying to help. Comments like "If I wanted to know what python module should I use for GUI programming - I would have asked that very question" and "The title clearly says python's Tkinter" rather put me off trying to help. – David Heffernan Jun 18 '11 at 20:26
  • Well I'm sorry - I didn't mean to offend you – speller Jun 18 '11 at 20:41