code: func progressBehavior(state *nstyle.WidgetStates, in *Input, r rect.Rect, maxval int, value int, modifiable bool) int {
  	if !modifiable {
  		*state = nstyle.WidgetStateInactive
  		return value
  	}
  
  	exitstate := basicWidgetStateControl(state, in, r)
  
  	if *state == nstyle.WidgetStateActive {
  		if !in.Mouse.Down(mouse.ButtonLeft) {
  			*state = exitstate
  		} else {
  			ratio := maxFloat(0, float64(in.Mouse.Pos.X-r.X)) / float64(r.W)
  			value = int(float64(maxval) * ratio)
  			if value < 0 {
  				value = 0
  			}
  		}
  	}
  
  	if maxval > 0 && value > maxval {
  		value = maxval
  	}
  	return value
  }
docs: ///////////////////////////////////////////////////////////////////////////////////
  // PROGRESS BAR
  ///////////////////////////////////////////////////////////////////////////////////