Tkinter LabelFrame to group widgets in a frame with Label and different options

preview_player
Показать описание
00:30 Creating LabelFrame
04:00 Adding font option
04:28 Background colour option
04:45 Foreground colour option
05:15 Cursor option
06:00 highlightthickness, highlightcolour, highlightbackground
08:23 labelanchor option
09:26 lableWidget option
10:00 padx pady

We can include a group of widgets and provide a Label by using LabelFrame widget of Tkinter. Here are different options and its uses while providing LabelFrame.

background
Background colour to use, check the Output in above code for lightgreen background colour
bg
Same as background
borderwidth
Width of the border of the Frame ( check examples below )
bd
Same as borderwidth
class
Assign class , default is Frame
colormap
specify which color map to use
container
Default is 0
cursor
List of cursor shape is available here . The shape of mouse pointer to be displayed over the frame
fg
Foreground colour
font
Font family, size and style ( see example )
height
Default is 0
highlightbackground
Default is system specific, Border colour when not in focus ( increase the highlightthickness to observe ).
highlightcolor
Default is system specific,Border colour when in focus ( increase the highlightthickness to observe )
highlightthicknes
Default is 0
labelAnchor
Alignment of Label Text, values can be e, en, es, n, ne, nw, s, se, sw, w, wn, or ws
See the example below.
labelwidget
Widget can be used as Label, if given then this is used in place of text option.
padx
Horizontal padding, Default is 0
pady
Vertical padding, Default is 0
relief
flat ( default ). The border decoration , values are flat, groove, raised, ridge, solid, or sunken
See the example at Button widget
takefocus
If true , tab can be used to move focus, Default is 0
visual
No Default
width
Default is 0

Source code is here

#TkinterLabelFrame #GroupOfWidgets #OptionsOfLabelFrame #Tkinter #Python #DatainLabelFrame #Options
Рекомендации по теме