Purpose: to provide examples to the beginning Tk programmer of how the -sticky configuration parameter works on the various Tk widgets that support the flag.
For instance:
frame .addr -background orange grid .addr -sticky we entry .addr.addr1 -width 30 grid .addr.addr1 -sticky we
The original author's expectation was that the field would be left justified and would expand. - RS would rather expect it to be centered, but fill all available space. Use -justify left for left justification :)
The originator wasn't talking about text within a label or whatever being justified. They were expecting the entry box to hang on the left of frame - me, I don't know why they expected that instead of centered... I certainly expected it centered.
The -sticky argument indicates the developer is specifying on which side(s) of a grid cell a widget should appear. The parms for the -sticky are one of the following:
or some reasonable combination of these flags.
So, a value of "we" would, in my mind, mean that a widget would be centered along the horizontal axis of the grid cell. A value of "ns" would indicate that a widget would be centered along the vertical axis of the grid cell. A value of "news" would, I presume, attempt to center the widget along both axies.
CRV Why doesn't this work?
It seems to work for me. Perhaps what you mean is "why doesn't this do what I expect", but I'm not sure what it is you expect
radiobutton .rbtDs -text "Description Group" -command {} labelframe .lbfDs -labelwidget .rbtDs frame .lbfDs.fraDs -bd 2 -relief sunken label .lbfDs.fraDs.lblLDs -text "Description" label .lbfDs.fraDs.lblDs -relief sunken -justify left button .lbfDs.fraDs.btnDlDs -text "X" -command {exit} grid .lbfDs grid .lbfDs.fraDs -stick ew grid .lbfDs.fraDs.lblLDs .lbfDs.fraDs.lblDs -sticky ew grid .lbfDs.fraDs.btnDlDs
Even adding '-width 400' to either the 'labelframe' or the 'frame' will change the displayed width.
Are you aware that row and column weights affect what expands and what does not? I don't know what effect you are trying to achieve, but you might tell us if this has a positive effect:
grid .lbfDs -sticky nsew grid rowconfigure . 0 -weight 1 grid columnconfigure . 0 -weight 1
The use of rowconfigure and columnconfigure on .lbfDs.fraDs is left as an exercise to the reader