1

How can I get (or calculate) the number from the interval [0.0, 1.0], which corresponds to the part of the canvas I'm viewing ? I need the number which is used in for example the canvas.yview_moveto(1.0)(which moves it to the bottom). In my case I only require the Y part. I need this number to be able to fix my previous problem which sadly didn't get fixed. I understand users often ask for a snippet, but in this case I hope it is not needed as I'm asking for either a built-in method or a way to do this. I simply have no idea how to even start with this. Thank you.

Past problem: Canvas leaves scrollregion if scrolled with mouswheel I fixed it using a scrollbar which has the .get() method returning the number as I need it, but I want a better solution, without the scrollbar.

Community
  • 1
  • 1
Jozef Méry
  • 357
  • 5
  • 15

1 Answers1

5

The yview method of a canvas, when called with no arguments, returns a tuple containing the two values you seek.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685