Artifacts Associated With Ticket 9ad28e91c089f89c
Ticket change [ef35d5cf5c] (rid 168303) by anonymous on 2019-01-17 15:51:32:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Summary: ProgressbarStepCommand’s behaviour differs from what is mentioned in its comments. If value reaches maximum exactly, the fmod() call resets it to 0. Details: I’m using Python’s tkinter, but could track down the bug I found to the Tcl/Tk source. My code iterates through a number of items; I set the progressbar maximum to that number and call the progressbar step command in each iteration to increase by 1. For example, with maximum = 42: after the first iteration, the value is 1.0, after the second it is 2.0 and so on until the second-to-last iteration, when it is 41.0. But on the last iteration, the value is reset to 0.0, resulting in an empty progress bar at the end of my computations. If I set value to maximum directly (without using successive calls to step), the progressbar is full, and when I read back the value it is equal to maximum. So code outside of ProgressbarStepCommand handles this case differently. The comment in ProgressbarStepCommand (file generic/ttk/ttkProgress.c) says: “In determinate mode, wrap around if value exceeds maximum”. Please note that wrap-around should occur when value *exceeds* maximum, which makes sense. The code however is: value = fmod(value, maximum) This already wraps around to 0.0 when value is *equal* to maximum. My suggestion: test for value > maximum, only then call fmod() Thanks!
- foundin initialized to: "8.6.9"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "e7e81e71688f47fe98b094316d502a5ce4f884ed"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to:
ProgressbarStepCommand sets value to 0 when reaching maximum
- type initialized to: "Bug"
Ticket change [45fe63a8c5] (rid 168316) by bll on 2019-01-17 18:13:05:
- closedate changed to: "2458501.25909038"
- closer changed to: "bll"
- icomment:
Copied to: https://core.tcl.tk/tk/tktview/7bf9bd3a6e4adb46a5b747758ca9b065a2a0bb92 as this is a Tk issue.
- login: "bll"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"