Tkinter callback problem

Chad Netzer cnetzer at mail.arc.nasa.gov
Thu Mar 13 20:57:03 EST 2003


On Thu, 2003-03-13 at 17:36, Ian Terrell wrote:
> > You could try using this definition of getint():
> >     def getint(x):
> >         if x == "??": return None
> >         return int(x)
> 
> If I'm going to be editing Python code to fix the problem, I think a
> more robust solution is to wrap the Tkinter.py calls in try/except
> like:
> 
> try:  getint(h)
> except:  pass

Might not be the best approach to handle all the fields, but if it gets
you going, that's fine (of course, the above code needs to include the
assignments to actually work).  It will require some investigation to
determine what fields can remain uninitialized and not cause
compatibility problems.

> That shouldn't take out any loss of functionality, and I'm sure
> Tkinter will adapt in a similar way to handle Tk 8.4.2 soon enough. =)

Well, that doesn't help existing users, unfortunately, who perhaps can't
or won't upgrade to future versions.

-- 
Bay Area Python Interest Group - http://www.baypiggies.net/

Chad Netzer
(any opinion expressed is my own and not NASA's or my employer's)







More information about the Python-list mailing list