Python Forum
What kind of widget is it?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What kind of widget is it?
#2
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.
"Often stumped... But never defeated."
Reply


Messages In This Thread
What kind of widget is it? - by aquerci - Apr-05-2020, 12:51 PM
RE: What kind of widget is it? - by DT2000 - Apr-05-2020, 05:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'Your first program' type question, be kind davediamond 0 1,085 Apr-11-2022, 08:12 PM
Last Post: davediamond
  Avoid multiple windows of the same kind backermaster 1 2,254 Oct-30-2018, 08:32 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020