Skip to content
Advertisement

How to get custom slider in tkinter?

I want to get a custom slider in tkinter or another slider like this one

slider

The default tkinter slider isn’t very good so how it can be changed ? (even the simplest way to do it)

I will appreciate if the thing is not done with a class because I did’nt put a single one in 300 lines of code and it will confuse me a bit, I won’t mix class/not class, I’ll just rewrite the code as a class with the self args but later

Here’s a simple Slider in tkinter :

JavaScript

How to make it customizable ?

A weird thing is that in some tutorials like this one https://www.pythontutorial.net/tkinter/tkinter-slider/

The tkinter slider are different from what I get or they’re presented in a different way

Advertisement

Answer

Try the following to use a more modernized scale widget using Tkinter’s ttk library:

JavaScript

Notice the differences between the two here

^ This is for macOS so it will look slightly different if you are on Windows.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement