TOC A. Label Frame B. Padding C. Handling Multiple Labels D. Sticky A. Label Frame Label frame is a plate of widgets. It ...
TOC
A. Label Frame
Label frame is a plate of widgets. It can hold other widgets on itself.
Image 1
- Line 6: To compare labels in label frame, this label is out of the label frame.
- Line 7: creates label frame. Label frame is in win widget.
- Line 11 - 14: creates labels in label frame. label frame has its own grid set.
B. Padding
Sometimes, an intentional empty space is required. Padding is the feature for the empty space.
Image 2
- Line 10: Label 5 has padx and pady properties. Therefore, Label 5 has 30 pixel padding for left and right and 60 pixel padding for up and down. By the padding of Label 5, column 1 has empty space with column 0 and column 2. Also, row 1 has empty space with row 0 and row 2.
C. Handling Multiple Labels
Label frame has an iterator of child widgets. winfo_childe method return child widget.
Image 3
- Line 6: creates label frame.
- Line 13: winfo_children() stores an widget to child.
- Line 14: grid_configure can update configuration.
D. Sticky
Sticky is a preperty to align widgets. By using this, widget can bias left, right, up and down. Also, it can set the widget at the center, or expand it.
Image 4
- Line 6 - 8: creates 3 labels to show grid.
- Line 10: creates button at the center.
- Line 11: creates button at the left border. W means WEST.
- Line 12: creates button at the right boder. E menas EAST.
- Line 13: creates button at the whole row.
COMMENTS