Skip to content
Tcl Source Code Artifact [ef35d5cf5c]
Login

Artifact [ef35d5cf5c]

Artifact ef35d5cf5c60aa4324afdbe7498f583af721352fd5a53d7ffbeac2772f9c2f40:

Ticket change [ef35d5cf5c] - New ticket [9ad28e91c089f89c|9ad28e91c0] <i>ProgressbarStepCommand sets value to 0 when reaching maximum</i>. by anonymous on 2019-01-17 15:51:32.
D 2019-01-17T15:51:32.440
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment Summary:\r\n\r\nProgressbarStepCommand’s\sbehaviour\sdiffers\sfrom\swhat\sis\smentioned\sin\sits\scomments.\s\sIf\svalue\sreaches\smaximum\sexactly,\sthe\sfmod()\scall\sresets\sit\sto\s0.\r\n\r\n\r\nDetails:\r\n\r\nI’m\susing\sPython’s\stkinter,\sbut\scould\strack\sdown\sthe\sbug\sI\sfound\sto\sthe\sTcl/Tk\ssource.\s\sMy\scode\siterates\sthrough\sa\snumber\sof\sitems;\sI\sset\sthe\sprogressbar\smaximum\sto\sthat\snumber\sand\scall\sthe\sprogressbar\sstep\scommand\sin\seach\siteration\sto\sincrease\sby\s1.\r\n\r\nFor\sexample,\swith\smaximum\s=\s42:\safter\sthe\sfirst\siteration,\sthe\svalue\sis\s1.0,\safter\sthe\ssecond\sit\sis\s2.0\sand\sso\son\suntil\sthe\ssecond-to-last\siteration,\swhen\sit\sis\s41.0.\sBut\son\sthe\slast\siteration,\sthe\svalue\sis\sreset\sto\s0.0,\sresulting\sin\san\sempty\sprogress\sbar\sat\sthe\send\sof\smy\scomputations.\r\n\r\nIf\sI\sset\svalue\sto\smaximum\sdirectly\s(without\susing\ssuccessive\scalls\sto\sstep),\sthe\sprogressbar\sis\sfull,\sand\swhen\sI\sread\sback\sthe\svalue\sit\sis\sequal\sto\smaximum.\s\sSo\scode\soutside\sof\sProgressbarStepCommand\shandles\sthis\scase\sdifferently.\r\n\r\nThe\scomment\sin\sProgressbarStepCommand\s(file\sgeneric/ttk/ttkProgress.c)\ssays:\s“In\sdeterminate\smode,\swrap\saround\sif\svalue\sexceeds\smaximum”.\sPlease\snote\sthat\swrap-around\sshould\soccur\swhen\svalue\s*exceeds*\smaximum,\swhich\smakes\ssense.\sThe\scode\showever\sis:\r\n\r\nvalue\s=\sfmod(value,\smaximum)\r\n\r\nThis\salready\swraps\saround\sto\s0.0\swhen\svalue\sis\s*equal*\sto\smaximum.\r\n\r\n\r\nMy\ssuggestion:\stest\sfor\svalue\s>\smaximum,\sonly\sthen\scall\sfmod()\r\n\r\nThanks!
J foundin 8.6.9
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact e7e81e71688f47fe98b094316d502a5ce4f884ed
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 18.\sCommands\sM-Z
J title ProgressbarStepCommand\ssets\svalue\sto\s0\swhen\sreaching\smaximum
J type Bug
K 9ad28e91c089f89cb28999b08b66ec1e3726e71b
U anonymous
Z e827f7b4f374fd8996358ec850631b8f