[Tutor] grid manager question
David
bouncingcats at gmail.com
Mon Feb 13 07:49:04 EST 2023
On Mon, 13 Feb 2023 at 20:43, Phil <phillor9 at gmail.com> wrote:
> The code below displays a list of circles, one per column.
Not for anyone except you it doesn't, because we can't 'import led3'.
> So far so
> good until I add any other widget under the row of circles. If I add a
> widget in column 8 then the circles are unaffected. If I add a widget
> into any other column (not the same row as the circles) then the circles
> move apart over that widget.
As Alan wrote, they move apart because they need to, so that the column
can accomodate the widget that you add later, which is wider than the
widget that you first put into the column.
> How do I prevent this? Adding pady to the widget doesn't seem to help.
Adding pady (vertical) wont help because it makes a widget taller, not wider.
To make the columns wider, you need to increase padx (horizontal).
And do that on the narrow first widget, not on the wider one that you add later.
And be sure to make it wider than the later widget plus double whatever
padx you specify on the later widget.
More information about the Tutor
mailing list