Python Forum
Tkinter - How can I change the default Notebook border color?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tkinter - How can I change the default Notebook border color?
#1
below my example code:

from tkinter import *
from tkinter import ttk

root = Tk()
root.geometry("400x300")

style=ttk.Style()
style.configure("TNotebook", highlightbackground="#848a98") # if I use another option like - background="#848a98" - the style changes, but with - highlightbackground="#848a98" - option the style doesn't change..

MainNotebook = ttk.Notebook(root, style="TNotebook")
MainNotebook.place(x=16, y=16)

Frame1=Frame(MainNotebook, background="#ffffff", width=200, height=150)
Frame1.pack()     
Frame2=Frame(MainNotebook, background="#ffffff", width=200, height=150)
Frame2.pack()

MainNotebook.add(Frame1, text="Tab1")
MainNotebook.add(Frame2, text="Tab2")

root.mainloop()
my goal is change the default border color in "#848a98" but the option highlightbackground="#848a98" doesn't work. am I using a wrong instruction? how can I solve my issue?

[Image: 56f87f1355823956.jpg]
Reply


Messages In This Thread
Tkinter - How can I change the default Notebook border color? - by TurboC - Oct-06-2020, 10:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [Solved]Change text color of one line in TextBrowser Extra 2 4,665 Aug-23-2022, 09:11 PM
Last Post: Extra
  [Tkinter] Tkinter don't change the image DQT 2 1,528 Jul-22-2022, 10:26 AM
Last Post: menator01
Question [Tkinter] Change Treeview column color? water 3 9,284 Mar-04-2022, 11:20 AM
Last Post: Larz60+
  Can't get tkinter button to change color based on changes in data dford 4 3,312 Feb-13-2022, 01:57 PM
Last Post: dford
  tkinter change the text of the checkbox zazas321 1 3,726 Sep-17-2021, 06:19 AM
Last Post: zazas321
Question [Tkinter] Can I set background color for each item in tkinter Combobox? water 1 5,030 Dec-10-2020, 07:48 PM
Last Post: Larz60+
  Tkinter menu font size -method to change tonycat 2 7,653 Oct-11-2020, 02:43 AM
Last Post: tonycat
  tkinter | Button color text on Click Maryan 2 3,295 Oct-09-2020, 08:56 PM
Last Post: Maryan
  [tkinter] color change for hovering over button teacher 4 8,258 Jul-04-2020, 06:33 AM
Last Post: teacher
  [PyQt] Increase text size and change color based on temp pav1983 5 3,061 Jun-22-2020, 10:52 PM
Last Post: menator01

Forum Jump:

User Panel Messages

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