Update copyright years for 2013
[gpodder.git] / tools / progressbar_icon_tester.py
blob8dd0017d5c9d8504a5cec8e6b13447a5f3baa794
1 #!/usr/bin/python
2 # Progressbar icon tester
3 # Thomas Perl <thp.io/about>; 2012-02-05
5 # based on: Simple script to test gPodder's "pill" pixbuf implementation
6 # Thomas Perl <thp.io/about>; 2009-09-13
8 import sys
9 sys.path.insert(0, 'src')
11 import gtk
13 from gpodder.gtkui.draw import draw_cake_pixbuf
15 def gen(percentage):
16 pixbuf = draw_cake_pixbuf(percentage)
17 return gtk.image_new_from_pixbuf(pixbuf)
19 w = gtk.Window()
20 w.connect('destroy', gtk.main_quit)
21 v = gtk.VBox()
22 w.add(v)
23 for y in xrange(1):
24 h = gtk.HBox()
25 h.set_homogeneous(True)
26 v.add(h)
27 PARTS = 20
28 for x in xrange(PARTS + 1):
29 h.add(gen(float(x)/float(PARTS)))
30 w.set_default_size(400, 100)
31 w.show_all()
32 gtk.main()