Tkinter canvas blow-up: bbox(ALL) == None

Fredrik Lundh fredrik at pythonware.com
Tue Nov 2 03:53:17 EST 1999


Randall Hopper <aa8vb at yahoo.com> wrote:
>      Apparently if the bounds of the items in a Tk canvas widget exceed
> MAXINT, bbox(ALL) returns None.  The attached Python script demonstrates
> this.
> 
>      Intuitively it seems like this is a bug since the contents of the
> canvas are maintained in floating point; integer bounds shouldn't be
> involved, should they?
> 
>      Is this a Tk bug or a Tkinter bug?

both.

Tkinter uses _getints instead of _getdoubles to
convert the bounding box to a tuple...

...but the reason you get None instead of an over-
flow error is that Tk returns an empty string in this
case (at least in 8.0.5).

</F>

<!-- (the eff-bot guide to) the standard python library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list