Skip to content
Tcl Source Code History Of Ticket 9ad28e91c089f89c
Login

History Of Ticket 9ad28e91c089f89c

Artifacts Associated With Ticket 9ad28e91c089f89c

  1. Ticket change [ef35d5cf5c] (rid 168303) by anonymous on 2019-01-17 15:51:32:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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!
      
    5. foundin initialized to: "8.6.9"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "e7e81e71688f47fe98b094316d502a5ce4f884ed"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "18. Commands M-Z"
    15. title initialized to:
      ProgressbarStepCommand sets value to 0 when reaching maximum
      
    16. type initialized to: "Bug"
  2. Ticket change [45fe63a8c5] (rid 168316) by bll on 2019-01-17 18:13:05:

    1. closedate changed to: "2458501.25909038"
    2. closer changed to: "bll"
    3. icomment:
      Copied to: https://core.tcl.tk/tk/tktview/7bf9bd3a6e4adb46a5b747758ca9b065a2a0bb92
      
      as this is a Tk issue.
      
    4. login: "bll"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"