How it works…

The LabelFrame widget takes the labelwidget option to set the widget used as a label. If it is not present, it displays the string passed as the text option. For instance, instead of creating an instance with tk.LabelFrame(master, text="Info"), you can replace it with the following statements:

label = tk.Label(master, text="Info", ...)
frame = tk.LabelFrame(master, labelwidget=label)
# ...
frame.pack()

This would allow you to do any kind of customization, such as adding an image. Note that we did not use any geometry manager for the label since it is managed when you place the frame.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset