Search code examples
tkinteronmouseovertabpanelrollover

how can I modify tabpanel color on mouse over


enter image description here

currently applied color is lightblue Now, As i used below configure,layout property of tabposition, Change color source may be included in it's sources

    tabpanelStyle = ttk.Style()
    # style.configure(tabposition='sw')
    tabpanelStyle.configure('TNotebook.Tab', padding=[10, 5], font=(
        'Malgun Gothic', '14', 'normal'), )

tabposition = ttk.Style()
tabposition.configure('TNotebook', sticky='w', tabposition='sw')
tabposition.layout("Tab",
                   [('Notebook.tab', {'sticky': 'nswe', 'children':
                                      [('Notebook.padding', {'side': 'top', 'sticky': 'nswe', 'children':
                                                             #[('Notebook.focus', {'side': 'top', 'sticky': 'nswe', 'children':
                                                             [('Notebook.label', {
                                                               'side': 'top', 'sticky': ''})],
                                                             #})],
                                                             })],
                                      })])
 frame1 = Frame(root)
    notebook.add(frame1, text="S")
    label1 = Label(frame1, text="S1")
    label1.pack()
    notebook.pack(padx=50)

Solution

  • There is an option called activebackground and activeforeground -

    tabposition.configure('TNotebook', sticky='w', tabposition='sw',activebackground='white')