I'm trying to apply a style to a slider widget in tkinter
. However, the changes to slider_style
parameters on the code below don't affect my_slider
. Specifically, I'm trying to change the trough width to something smaller. I have seen on different tutorials that either the width
or the sliderthickness
parameters might do the trick, but I had no luck with either (or with any other style parameter, for that matter). Here is the relevant code:
from tkinter import *
import tkinter.ttk as ttk
window_width = 1000
window_height = 100
root = Tk()
root.title('Measure Marker')
root.geometry(f'{window_width}x{window_height}')
slider_style = ttk.Style()
slider_style.configure('SliderStyle.Horizontal.TScale', width=5, sliderthickness =5)
my_slider = ttk.Scale(root, from_=0, to=100, length=900, style='SliderStyle.Horizontal.TScale')
my_slider.pack(pady=30)
root.mainloop()
Am I applying SliderStyle
correctly? Is that the way to go to change the trough width?
I tried to do this a while ago, this works I literally just tested it,