Tkinter support scrollbar look modification

In tkinter we cannot modify the look of scrollbars, there’s some codes that are meant to work (because they are not giving unknown attribute error) but which are changing nothing. Please support that fast as possible. To show you why i want that look at this window i’ve made:

As you see it would perfect if if i could change the scrollbars

See tkinter.ttk — Tk themed widgets — Python 3.9.1 documentation

style.configure(“RW.TLabel”, foreground=“red”, background=“black”)

    scrollbar = Scrollbar(DecodedTextBox, orient="vertical", command=DecodedTextBox.yview, cursor="arrow", style="RW.TLabel")
    scrollbar.pack(fill="y", side="right")

    xscrollbar = Scrollbar(DecodedTextBox, orient="horizontal", command=DecodedTextBox.xview, cursor="arrow", style="RW.TLabel")
    xscrollbar.pack(fill="x", side="bottom")

it says unknown option ‘style’ in Scrollbar do you know why pls?

I checked a lots of other forum posts , all are saying that modifying scrollbars isn’t possible even by using ttk. So please support me in order to make them that add that function in the next updates

The documentation is lacking a lot of information, but the following works here:

from tkinter import *
from tkinter.ttk import *

app = Tk()
style = Style()
style.element_create('Fruitsalad.Horizontal.Scrollbar.trough', 'from', 'default')
style.element_create('Fruitsalad.Horizontal.Scrollbar.thumb', 'from', 'default')
style.element_create('Fruitsalad.Horizontal.Scrollbar.leftarrow', 'from', 'default')
style.element_create('Fruitsalad.Horizontal.Scrollbar.rightarrow', 'from', 'default')
style.element_create('Fruitsalad.Horizontal.Scrollbar.grip', 'from', 'default')
        ('Fruitsalad.Horizontal.Scrollbar.trough', {'children':
            [('Fruitsalad.Horizontal.Scrollbar.leftarrow', {'side': 'left', 'sticky': ''}),
             ('Fruitsalad.Horizontal.Scrollbar.rightarrow', {'side': 'right', 'sticky': ''}),
             ('Fruitsalad.Horizontal.Scrollbar.thumb', {'unit': '1', 'children':
                 [('Fruitsalad.Horizontal.Scrollbar.grip', {'sticky': ''})],
            'sticky': 'nswe'})],
            'sticky': 'we'}),
    background=[('pressed', '!disabled', 'pink'), ('active', 'orange')])
scrollbar = Scrollbar(app, orient='horizontal', style='Fruitsalad.Horizontal.TScrollbar')
scrollbar.set(0.0, 0.5)



thanks i will check that

It still does not work

In anyway even if it was working, Python must add an easier way, why background and foreground not working as meant to, as in other widgets? PLS SHARE THIS POST. THE MORE POPULAR IT IS, THE MORE IT IS CONSIDERED.

For examples you may want to take a look at GitHub - rdbende/Azure-ttk-theme: Azure theme is a beautiful and modern theme for ttk and

I tried azur’s theme on another widget but it didn’t work.

When talking about tk and hence tkinter, issues must include the OS. Peter’s code works as shown on Windows. I would not be surprised is it does not work on macOS, as the latter ignores some tk settings. For instance, button text backgrounds (but not foregrounds) are ignored. So a programmed white on color, as with turtledemo, shows as white on white :wink: … maybe unless one selects the fairly new macOS dark theme.

Ihsan, all caps shouting is a bit rude.