1

I have searched here for this query, but I didn't find an answer for this except setting up the font size of widgets inside the Notebook

As I mentioned in the title, I would like to increase the font size of Tab header. For example,

transaction_book = ttk.Notebook(frame)
transaction_book.place(relwidth=0.6, relheight=0.79, relx=1, rely=0.21, anchor='ne')

#Make 1st tab
f1 = tk.Frame(transaction_book)
#Add the tab
transaction_book.add(f1, text="Tab one")

#Make 2nd tab
f2 = tk.Frame(transaction_book)
#Add 2nd tab
transaction_book.add(f2, text="Tab two")

transaction_book.select(f1)

In the above code, I would like to increase the Tab headers "Tab One" and "Tab Two" to a bigger size.

Kindly suggest if there is a way to achieve this.

martineau
  • 119,623
  • 25
  • 170
  • 301
Jayakumar
  • 65
  • 11
  • 2
    "The other approach..." shown in the [accepted answer](https://stackoverflow.com/a/54213658/355230) to the linked question shows how to change the font size of tab headers. – martineau Dec 17 '19 at 00:54
  • @martineau: I missed the 's.theme_use("MyStyle")' line in my code. – Jayakumar Dec 17 '19 at 07:08

1 Answers1

1

Easiest solution is,

    style = ttk.Style()
    style.configure('TNotebook.Tab', font=('URW Gothic L','15','bold'), padding=[10, 10])

    transaction_book = ttk.Notebook(frame)
    transaction_book.place(relwidth=0.6, relheight=0.80, relx=1, rely=0, anchor='ne')
Jayakumar
  • 65
  • 11