[Tkinter-discuss] When to use a Canvas vs. a Frame from a container perspective?

Michael O'Donnell michael.odonnell at uam.es
Sat Dec 18 18:47:15 CET 2010


Hi Malcom,

  I use both Canvas and Text for scrollable containers.

I use the Canvas when I want pixel accurate placement.

I use a Text widget for more lazy placement (one can place
items after each other on a row, and start a new row with a "\n").
One can make spreadsheets by placing rows of entry widgets of
equal width.

However, with hundreds of widgets in a text widget, I find performance
suffers.

Mick

On Fri, Dec 17, 2010 at 10:07 PM,  <python at bdurham.com> wrote:
> Michael,
>
>> However I agree, it's better to use create_window() to avoid pitfalls like this.
>
> 1. So the proper way to use Canvases as containers for traditional
> widgets is to manually handle layout and place all widgets via the
> create_window() method.
>
> 2. The only reason to use a Canvas as a container for traditional
> widgets is when you need a scrollable container.
>
> Are those points accurate?
>
> Thanks,
> Malcolm
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>


More information about the Tkinter-discuss mailing list