?
=?ISO-8859-1?Q?Mickel_Gr=F6nroos?=
Hi,
I have a Tkinter.Canvas of variable width. Is there a standard way of
asking the canvas which parts of it that is visible? I.e. on the
horizontal scale, I would like to know at what fraction from the left the
left visibility border is and from what fraction to the right the right
visibility border is.
Consider this ascii picture as an example
+-------------------------------+
| |<-- the full canvas
| a------------------+ |
| | |<--------- the currently visible part
| +------------------b |
| |
+-------------------------------+
I would like to be able to ask the canvas something like:
t = canvas.visiblebox()
and it would return a two-tuple of two-tuples with coordinates (of the
a and b points in the picture above), say:
t = ((10,10), (90,30))
Using these values I could calculate the fractions myself.
Any ideas?
/Mickel
I have a Tkinter.Canvas of variable width. Is there a standard way of
asking the canvas which parts of it that is visible? I.e. on the
horizontal scale, I would like to know at what fraction from the left the
left visibility border is and from what fraction to the right the right
visibility border is.
Consider this ascii picture as an example
+-------------------------------+
| |<-- the full canvas
| a------------------+ |
| | |<--------- the currently visible part
| +------------------b |
| |
+-------------------------------+
I would like to be able to ask the canvas something like:
t = canvas.visiblebox()
and it would return a two-tuple of two-tuples with coordinates (of the
a and b points in the picture above), say:
t = ((10,10), (90,30))
Using these values I could calculate the fractions myself.
Any ideas?
/Mickel