best way to increment an IntVar?

rantingrick rantingrick at gmail.com
Fri Jun 25 13:24:43 EDT 2010


On Jun 25, 9:12 am, Alan G Isaac <alan.is... at gmail.com> wrote:
> On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote:
>
> > It is NOT a numeric "variable" in Python realms.
>
> Sure, but why does it not behave more like one?
> It seems both obvious and desirable, so I'm
> guessing there is a good reason not to do it.

This is a good point. And i have always believed the IntVar should
work this way. However it has not been changed because those who have
the power to change it really don't use GUI's (much less Tkinter) or
for that matter really care. I fear your laments will only fall on
deaf ears as the many before you. However i find the control vars in
most instances not really the best choice. For check buttons and
radiobuttions they are essintial, however for labels, texts,
listboxes, etc, just use w.config()

As another example; IDLE is full of atrocities like using built-ins
for variables, polluting namespaces with from Tkinter import * (not to
mention that this slows load time to a crawl when you have load 30
namespaces with 500 or so names), the package is missing much needed
comments and doc strings, and the most annoying and i would say
*idiotic* of all is the "if __name__ == '__main__' tests" use
root.quit instead of root.destroy! WTF! So after you run your test and
try to press the little red X button to close the window guess what
happens...yes the mainloop quits processing events but the GUI stays
plopped right there on your monitor until you go and kill the process
from task manager... WHAT F'N MORON WROTE THIS CODE?!?! But what is
more amazing is how this atrocious code has lingered the stdlib for so
long. People it's time to wake up, IDLE needs a complete re-write.

But i wonder how many have called for changes and those changes have
fallen on deaf ears. How many have submitted beautiful code only to be
ignored because of childish rivalries? Why do i even waste my time
posting to this group? There's a good question.



More information about the Python-list mailing list