# -*- encoding:Utf8 -*-

# Démonstration du widget Scale

from tkinter import *

class Curseur(Tk):

    def __init__(self):
        Tk.__init__(self)
        self.curseur = Scale(master=self, length = 250,
                             orient = HORIZONTAL,
                             label = 'Réglage :',
                             troughcolor = 'dark grey',
                             sliderlength = 20,
                             showvalue = 0, from_ = -25,
                             to = 125, tickinterval = 25,
                             command = self.updateLabel)
        self.curseur.pack()
        self.lab = Label(self)
        self.lab.pack()

    def updateLabel(self, x):
        self.lab.configure(text = 'Valeur actuelle = '
                           + str(x))
                             

### Partie principale du programme ###

root = Curseur()
root.mainloop()
