Tkinter

Jason Swails jason.swails at gmail.com
Wed Apr 3 08:05:53 EDT 2013


On Tue, Apr 2, 2013 at 10:04 PM, Renato Barbosa Pim Pereira <
renato.barbosa.pim.pereira at gmail.com> wrote:

> Thanks for the advices, I need now one scrollbar to roll under screen, I
> created the scrollbar but cant roll, please help me on this.
>
> http://pastebin.com/L6XWY6cm
>


You need to bind your scrollbar to a particular action.  It does not roll
because you never told it what 'rolling' should do.  That said, you need to
bind your scrollbar command to a widget that actually supports scrolling.
 According to [1], your options are the Listbox, Text, Canvas, and Entry
widgets.  What that means is that you will need to replace your Frame
widget with a Canvas widget (or embed a Canvas in your Frame, although with
your existing code that latter approach does not serve much purpose).  Then
bind your scrollbar command to the xview method of your Canvas instance (or
the yview method of your Canvas instance if you want to scroll vertically).

HTH,
Jason

[1] http://effbot.org/zone/tkinter-scrollbar-patterns.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130403/7013c35e/attachment.html>


More information about the Python-list mailing list