Scrolled canvas confusion

John Grayson johngrayson at home.com
Mon Jun 5 10:21:32 EDT 2000


In article <8hg4a3$a09$1 at zingo.tninet.se>,
  "André Dahlqvist" <andre at beta.telenordia.se> wrote:
> Hi
>
> I have an application (using Tkinter) which currently stacks a bunch
of
> buttons on top of each other in a Frame. The number of these buttons
> change dynamically, which sometimes causes them to not fit on the
> screen. For this reason I'd like to use a scrollbar. Since the Frame
class
> doesn't have a yscrollcommand I think I need to pack this frame into a
> Canvas, and then somehow use the create_window method with
> the frame as an argument. What confuses me though are the various
> coordinates, like the scrollregion of the Canvas and the x and y
> coordinates to the create_window method. Also I don't know what
> sizes to give the Frame and Canvas to make them behave as I want
> them to. If possible I'd like to do this with plain Tkinter, no Pmw.
>
> I would greatly appreciate any help. A small example would be
> great.
>
> // André
>

If you don't want to use Pmw (which is only Tkinter code anyway),
then look at PmwScrolledFrame.py and extract the bits you want and
manage resources directly.

If you want an example of putting buttons inside a scrolled frame,
see page 69 of Python and Tkinter Programming.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list