How to set image on tab
in ttk.notebook tabs ?
The following code isn't working, the image doesn't appear:
import tkinter as tk
from tkinter import ttk
class Tab(tk.Frame):
def __init__(self, master, *args, **kwargs):
super().__init__(master, *args, **kwargs)
self.label = tk.Label(self, text='Blablablee')
self.label.pack()
root = tk.Tk()
notebook = ttk.Notebook(root)
notebook.pack()
notebook.add(Tab(notebook),
text='Tab1',
image=tk.PhotoImage(file='icon.png'),
compound='left')
root.mainloop()