【问题标题】:how can I modify tabpanel color on mouse over如何在鼠标悬停时修改标签面板颜色
【发布时间】:2021-06-26 10:50:18
【问题描述】:

enter image description here

当前应用的颜色是浅蓝色 现在,正如我在下面使用的配置,tabposition 的布局属性,更改颜色源可能包含在它的源中

    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)

【问题讨论】:

    标签: tkinter onmouseover tabpanel rollover


    【解决方案1】:

    有一个选项叫activebackgroundactiveforeground -

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-29
      • 2023-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多