Tkinter "scrollregion" verbosity

Siggy Brentrup bsb at north.de
Wed Sep 29 03:07:27 EDT 1999


Greg Ewing <greg.ewing at compaq.com> writes:

> Greg McFarlane wrote:
> > 
> > Maintaining this list across versions of Tk (and Blt
> > and Tix and ...) would become a nightmare, so "always a string" is
> > probably as good as you'll get :)
> 
> Methods could be provided for commonly used non-string 
> attributes. Should be, I would say.

> Also, how about variants of cget() which return different
> types, e.g. cgeti() for getting integer attributes, to fill
> any gaps in the set of methods.

Who - except for possibly your boss - hinders you from using the
following trick:


Python 1.5.2+ (#1, Sep 22 1999, 00:31:19)  [GCC egcs-2.91.66 19990314 (egcs-1.1.2 release)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
IDLE 0.5 -- press F1 for help
>>> import Tkinter
>>> Tkinter.Misc.intcget = lambda self, o: int(self.cget(o))
>>> root = Tkinter.Tk()
>>> root.intcget('width')
0
>>> type(root.intcget('width'))
<type 'int'>
>>> int(root.cget('width'))
0
>>>

Personally I prefer the last variant, but if you want to save
keystrokes: the above is legal python code.

IMHO esp. in the light of Tcl/Tk the interface, there is no
need to include cget variants in Tkinter.

CU
  Siggy

-- 
noch nichts Aufregendes:

Siggy Brentrup - bsb at north.de - voice: +49-441-6990134





More information about the Python-list mailing list