|
|
|
|
|
by DanHulton
1414 days ago
|
|
One way in which it is not simple is that you can't set what the "max" of the bar is and have it auto-calculate the percentage. Like, if I have 7 tasks to accomplish, I have to manually keep track of the percentage to increase it by, and since 7 doesn't increase cleanly, I probably have to custom-code the final update to 100 manually, or it'll be just under or over, depending on how I round. Or maybe I have a variable number of tasks, and instead of increasing by a constant, I have to have separate variables for calculating the amount to increase by. I know every feature added to something simple adds unforeseen levels of complexity, but this choice doesn't eliminate complexity, it just moves the complexity to calling code, and for nearly every use case. |
|
What do you mean with "not cleanly"?
bar.update_smooth(i * 100 / 7)
Once i is 7, this will be equal to 100. No matter your rounding mode. You don't need a CS degree for that formula.