Prevent Tkinter Canvas from resizing

E

Eric Wong

Using Tkinter, I have a Canvas with vertical Scrollbar attached. At
runtime, I dynamically create Checkboxes on the Canvas, each one on a
different row. When I add a lot of Checkboxes, instead of the
scrollbar kicking in, the Canvas resizes and subsequently, my
Application window resizes such that it is larger than my monitor.

Can I prevent the Canvas from resizing when I am creating widgets on it
at runtime? I want to use the scrollbars when there are more
Checkboxes than will fit on the visible Canvas. Is this possible?
Thanks for any help.
 
F

Fredrik Lundh

Eric said:
Using Tkinter, I have a Canvas with vertical Scrollbar attached. At
runtime, I dynamically create Checkboxes on the Canvas, each one on a
different row. When I add a lot of Checkboxes, instead of the
scrollbar kicking in, the Canvas resizes and subsequently, my
Application window resizes such that it is larger than my monitor.

Can I prevent the Canvas from resizing when I am creating widgets on it
at runtime? I want to use the scrollbars when there are more
Checkboxes than will fit on the visible Canvas. Is this possible?

if you want scrolling widgets, you need to create the widgets *in* the
canvas (using create_window), rather than on top of the canvas (using
the canvas as the master).

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top