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
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)