Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A formal parsing algorithm should not always be used. -- D. Gries


devel / comp.lang.tcl / `pack/grid -in` depends on frame creation order ?

SubjectAuthor
* `pack/grid -in` depends on frame creation order ?xol odho
`* `pack/grid -in` depends on frame creation order ?Harald Oehlmann
 `- `pack/grid -in` depends on frame creation order ?xol odho

1
`pack/grid -in` depends on frame creation order ?

<c002076a-08b4-4735-aac4-9b6a8160a463n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10068&group=comp.lang.tcl#10068

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:8107:0:b0:496:a715:dc8c with SMTP id 7-20020a0c8107000000b00496a715dc8cmr43230786qvc.96.1667800281631;
Sun, 06 Nov 2022 21:51:21 -0800 (PST)
X-Received: by 2002:a05:620a:f88:b0:6e0:15aa:72e0 with SMTP id
b8-20020a05620a0f8800b006e015aa72e0mr33699447qkn.40.1667800281482; Sun, 06
Nov 2022 21:51:21 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sun, 6 Nov 2022 21:51:21 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=201.231.246.253; posting-account=DnakAAoAAAA9ZZlBDSXHBE9MWv_A1hHG
NNTP-Posting-Host: 201.231.246.253
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c002076a-08b4-4735-aac4-9b6a8160a463n@googlegroups.com>
Subject: `pack/grid -in` depends on frame creation order ?
From: xolo...@gmail.com (xol odho)
Injection-Date: Mon, 07 Nov 2022 05:51:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1709
 by: xol odho - Mon, 7 Nov 2022 05:51 UTC

Hello everyone. The quest for learning Tk goes on... so much to learn. So,
today I have the following question.

I'm trying to understand what causes the difference in behavior between
the following two scripts, A and B:

A:

frame .f
button .b -text hallo
pack .f
pack .b -in .f

B:

button .b -text hallo
frame .f
pack .f
pack .b -in .f

A and B are the almost the same but just with .f and .b created in
different order. I was expecting these two variations to behave the same,
but they don't: when .f is created before .b, the button .b appears, the
second version doesn't show the button.

The same happens if "grid" is used instead of "pack".

Why is this?

Re: `pack/grid -in` depends on frame creation order ?

<tka8cv$3hcem$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10069&group=comp.lang.tcl#10069

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: `pack/grid -in` depends on frame creation order ?
Date: Mon, 7 Nov 2022 07:25:39 +0100
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <tka8cv$3hcem$1@dont-email.me>
References: <c002076a-08b4-4735-aac4-9b6a8160a463n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 7 Nov 2022 06:25:36 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="2843aac443762a7eaff6ad9bb58128da";
logging-data="3715542"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3TJO2TgHHgWPPtQ7x2tk3"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:D6v8L9ppm48BDCvyGtNwFjVc+Hs=
In-Reply-To: <c002076a-08b4-4735-aac4-9b6a8160a463n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Mon, 7 Nov 2022 06:25 UTC

Am 07.11.2022 um 06:51 schrieb xol odho:
> Hello everyone. The quest for learning Tk goes on... so much to learn. So,
> today I have the following question.
>
> I'm trying to understand what causes the difference in behavior between
> the following two scripts, A and B:
>
> A:
>
> frame .f
> button .b -text hallo
> pack .f
> pack .b -in .f
>
> B:
>
> button .b -text hallo
> frame .f
> pack .f
> pack .b -in .f
>
>
> A and B are the almost the same but just with .f and .b created in
> different order. I was expecting these two variations to behave the same,
> but they don't: when .f is created before .b, the button .b appears, the
> second version doesn't show the button.
>
> The same happens if "grid" is used instead of "pack".
>
> Why is this?

You have two points to consider:
- tabbing order
- clipping order

Clipping order is set by creation time.
It may be modified by the raise command.
So, "raise .b" will probably show the button.
As a rule of thumb, first create the parents, then the childs.

The 2nd point of this complex is tabbing order.

Try
pack [entry .1] -side top
pack [entry .2] -side top
pack [entry .3] -side top

and

pack [entry .1] -side top
pack [entry .3] -side bottom
pack [entry .2] -side top

and use the tab-key to cycle between the widgets.

Harald

Re: `pack/grid -in` depends on frame creation order ?

<86649869-c902-4f1f-b84a-749c27cf14e3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10081&group=comp.lang.tcl#10081

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:2601:b0:4bb:f5ef:998a with SMTP id gu1-20020a056214260100b004bbf5ef998amr39731696qvb.69.1667851241417;
Mon, 07 Nov 2022 12:00:41 -0800 (PST)
X-Received: by 2002:a05:622a:1051:b0:3a5:8444:e813 with SMTP id
f17-20020a05622a105100b003a58444e813mr6666550qte.99.1667851241192; Mon, 07
Nov 2022 12:00:41 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 7 Nov 2022 12:00:40 -0800 (PST)
In-Reply-To: <tka8cv$3hcem$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=201.231.246.253; posting-account=DnakAAoAAAA9ZZlBDSXHBE9MWv_A1hHG
NNTP-Posting-Host: 201.231.246.253
References: <c002076a-08b4-4735-aac4-9b6a8160a463n@googlegroups.com> <tka8cv$3hcem$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86649869-c902-4f1f-b84a-749c27cf14e3n@googlegroups.com>
Subject: Re: `pack/grid -in` depends on frame creation order ?
From: xolo...@gmail.com (xol odho)
Injection-Date: Mon, 07 Nov 2022 20:00:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1538
 by: xol odho - Mon, 7 Nov 2022 20:00 UTC

Hi, thanks for the answer!
It's very clear now.

Seems I had read about this in Ousterhout's book and totally forgot about it.
I usually create the frames before the widgets, that's why I forgot about the potential need to use `raise`. I'll keep it in mind :)

Actually it is explained on page 406 of the 2nd edition of that book, (section 21.7 Hierarchical Geometry Management).

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor