5 class ProgressBar(widget
.Widget
):
8 <pre>ProgressBar(value,min,max)</pre>
11 <dt>value<dd>starting value
12 <dt>min<dd>minimum value rendered on the screen (usually 0)
13 <dt>max<dd>maximum value
16 <strong>Example</strong>
18 w = gui.ProgressBar(0,0,100)
23 def __init__(self
,value
,min,max,**params
):
24 params
.setdefault('cls','progressbar')
25 widget
.Widget
.__init
__(self
,**params
)
26 self
.min,self
.max,self
.value
= min,max,value
29 r
= pygame
.rect
.Rect(0,0,self
.rect
.w
,self
.rect
.h
)
30 r
.w
= r
.w
*(self
.value
-self
.min)/(self
.max-self
.min)
32 pguglobals
.app
.theme
.render(s
,self
.style
.bar
,r
)
34 def __setattr__(self
,k
,v
):
39 _v
= self
.__dict
__.get(k
,NOATTR
)
41 if k
== 'value' and _v
!= NOATTR
and _v
!= v
: