3 from . import pguglobals
5 class ProgressBar(widget.Widget):
6 """A progress bar widget.
9 w = gui.ProgressBar(0,0,100)
16 def __init__(self,value,min,max,**params):
17 params.setdefault('cls','progressbar')
18 widget.Widget.__init__(self,**params)
19 self.min,self.max,self.value = min,max,value
22 if (self.value != None):
23 r = pygame.rect.Rect(0,0,self.rect.w,self.rect.h)
24 r.w = r.w*(self.value-self.min)/(self.max-self.min)
26 pguglobals.app.theme.render(s,self.style.bar,r)
35 val = max(val, self.min)
36 val = min(val, self.max)