Tkinter Scrollbar get method

Fredrik Lundh fredrik at pythonware.com
Wed Jul 4 13:06:39 EDT 2001


Lee Harr wrote:

> I am trying to use the Tkinter Scrollbar class.
> The docs say that the get() method returns a
> two element tuple of values between 0.0 and 1.0
>
> What I am getting, though is a 4 element tuple:

it's a weird backwards compatibility thing; if you call "get" directly
after you've created the scrollbar, it operates in "pre-Tk 4.0" mode,
and returns four values:

    total, window, first, last

to get normal behaviour, you have to call the "set" method with
two arguments (see the docs).  once you've done this, "get" will
work as documented.

note that if you attach a scrollbar to a scrollable widget, Tk(inter)
will do this for you all by itself.

</F>

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





More information about the Python-list mailing list