Python Forum

Full Version: What kind of widget is it?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

someone can help me to understand what kind of widget has been circled in red in the attached image?

I would very like to replicate it in my GUI but I don't know how. it seems a "LabelFrame" widget (I attached another image), but it's not the same. How can I create the same widget with tkinter?

sorry guys, maybe it's an obvious question, but I don't know tkinter so much, I started studying recently.
I believe what you are looking to use would be the ttk.Separator.

import tkinter as tk
from tkinter import ttk

root = tk.Tk()
# PADX aligns the Separator clearance from edge of left side and right side
PADX = 5

toolbar = tk.Frame(root).grid(padx=100, pady=10)

button1 = tk.Button(toolbar, text="Home").grid(padx=10,pady=10)
sep = ttk.Separator(toolbar, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=10, sticky=tk.EW)
sepL =tk.Label(toolbar, text="   Using a 'ttk.Separator' widget").grid(padx=PADX, sticky=tk.W)
button2 = tk.Button(toolbar, text="Insert").grid(padx=50, pady=10)

root.mainloop()
I hope this helps and points you in the right direction.