Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

grid columnconfigure -uniform

132 views
Skip to first unread message

Matthias Meier

unread,
Oct 6, 2011, 8:25:27 AM10/6/11
to
Hello,

as far as i unterstand the '-uniform' option, columns (or rows) should have the same size as long as the -weight value is the same.

That means with the following script

---------------------------------------
toplevel .t

frame .t.f1
frame .t.f2

label .t.f1.l1 -text "label1"

label .t.f2.l2 -text "label2 with more text"

entry .t.f1.e1 -width 5
entry .t.f2.e2 -width 10

grid .t.f1 -row 0 -sticky w
grid .t.f2 -row 1 -sticky w

grid .t.f1.l1 -row 0 -column 0
grid .t.f1.e1 -row 0 -column 1

grid .t.f2.l2 -row 0 -column 0
grid .t.f2.e2 -row 0 -column 1

grid columnconfigure .t.f1 0 -uniform sameSize -weight 1
grid columnconfigure .t.f2 0 -uniform sameSize -weight 1
---------------------------------------

the entry e1 and e2 should be aligned (start at the same x-position).
But they are not.

Is my unterstanding wrong?

Can i align the entries as long as they are in seperate frames?


Thanks,
Matthias

Andreas Leitgeb

unread,
Oct 6, 2011, 11:53:21 AM10/6/11
to
Matthias Meier <Me...@FuH-E.de> wrote:
> as far as i unterstand the '-uniform' option, columns (or rows)
> should have the same size as long as the -weight value is the same.

I think this is only within the same direct master

slightly different example:

toplevel .t
set l {1 2 3 4 5}
foreach i $l { entry .t.e$i -width $i }
foreach i $l { grid .t.e$i -row 0 -column $i }
foreach i $l { grid columnconfigure .t $i -weight 1 }
# with different "-uniform"s
foreach i $l { grid columnconfigure .t $i -uniform $i }
# with same "-uniform"s
foreach i $l { grid columnconfigure .t $i -uniform x }

Since here a difference is observable, but not in your example
of separate masters (.t.f1 and .t.f2), I conclude that these
identifiers are only grouped within a particular master.

Bruce

unread,
Oct 6, 2011, 12:59:48 PM10/6/11
to
On 10/6/2011 7:25 AM, Matthias Meier wrote:
> Hello,
>
> as far as i unterstand the '-uniform' option, columns (or rows) should
> have the same size as long as the -weight value is the same.
>
(withing the container being managed by grid)

> That means with the following script
>
( Snip example with wigets in 2 different frames )
>
> Is my unterstanding wrong?

yes, the -uniform is for making different columns within the same
container the same size (or strictly proportional to the weight)

You have different containers - get rid of the different frames
and grid all your widgets into a single frame and you will get your
nice alignment.

>
> Can i align the entries as long as they are in seperate frames?
>

yes, by making the widths explicitly the same - the geometry manager
can't manage across separate containers
>
> Thanks,
> Matthias

0 new messages