Tk Source Code

Artifact [f2d16bb6]
Login

Artifact f2d16bb6bff94028cc879badd0f3141bcb26ad25d3cd18d39fef9ce53872c14c:

Ticket change [f2d16bb6] - New ticket [ef1bfef5] Error in computing return value of AnimationEnabled for ttk progress bar. by marc_culler 2025-03-06 03:09:54.
D 2025-03-06T03:09:54.242
J assignee nobody
J closer nobody
J cmimetype text/x-markdown
J comment I\snoticed\san\samazing\sbug\sin\sthe\simplementation\sof\sthe\sttk\sprogress\sbar\swhen\sI\swas\slooking\sinto\s[7e28ef577a].\s\sWhen\sthe\sloop\sincrementing\sthe\sprogress\sbar\sreached\sthe\send,\sthe\sprogress\sbar\swas\srapidly\sredisplayed\seven\sthough\snothing\swas\schanging.\s\s(The\svalue\sat\sthe\send\sof\sthe\sloop\swas\s99.)\sIt\sturned\sout\sthat\sAnimationEnabled\swas\sreturning\s1\seven\sthough\sthe\sprogress\sbar\swas\sdeterminate.\s\sThe\scause\swas\sa\smisplaced\sparenthesis\sdating\sback\sto\s2006.\r\n\r\nThe\seffect\sis\sto\smake\sany\sdeterminate\sprogress\sbar\sbe\sanimated\salmost\sall\sof\sthe\stime.\sThis\smay\sexplain,\sat\sleast\spartly,\sthe\sreports\sthat\sprogress\sbars\ssignificantly\sincrease\sCPU\susage\seven\swhen\sthey\sare\snot\sdoing\sanything.\r\n\r\nHere\sis\sthe\sproblematic\scode:\r\n```\r\n\s\s\s\sreturn\spb->progress.period\s>\s0\r\n\t&&\svalue\s>\s0.0\r\n\t&&\s(\s\s\svalue\s<\smaximum\r\n\t\s\s\s\s||\spb->progress.mode\s==\sTTK_PROGRESSBAR_INDETERMINATE);\r\n```\r\n\r\nThe\scorrect\scode\s(with\sextra\sparentheses\sfor\sclarity)\swould\sbe:\r\n```\r\n\s\s\s\sreturn\s(pb->progress.period\s>\s0\s&&\svalue\s>\s0.0\s&&\svalue\s<\smaximum)\r\n\t||\s(pb->progress.mode\s==\sTTK_PROGRESSBAR_INDETERMINATE);\r\n```
J foundin 9.0.1
J is_private 0
J login marc_culler
J priority 5\sMedium
J private_contact 4a267845b96d18ced148980dad8c23b791785018
J resolution None
J severity Important
J status Open
J submitter marc_culler
J subsystem 88.\sThemed\sTk
J title Error\sin\scomputing\sreturn\svalue\sof\sAnimationEnabled\sfor\sttk\sprogress\sbar
J type Bug
K ef1bfef57e05099e93f1eb0960e658def076e424
U marc_culler
Z bad5dee58b579c00dbdf950e43b789b1