Scale Widgets : Scale « Tkinker « Python Tutorial






Scale Widgets
from Tkinter import *

class ScaleTest :
    def CloseMe(self) :
        self.value = self.scale.get()
        self.root.destroy()

    def __init__(self) :
        self.value = 0
        self.root = Tk()
        self.root.geometry("500x300")

        self.scale = Scale( self.root, from_=0, to=100, orient=HORIZONTAL )
        self.scale.pack()

        Button( self.root, text="Close", command=self.CloseMe ).pack()

        self.root.mainloop()

st = ScaleTest()
print "Value = " + str(st.value)








18.27.Scale
18.27.1.Scale with variableScale with variable
18.27.2.Get scale value
18.27.3.Label, Button, and Scale DemoLabel, Button, and Scale Demo
18.27.4.Scale used to control the size of a circle.Scale used to control the size of a circle.
18.27.5.Scale WidgetsScale Widgets
18.27.6.Show current value of ScaleShow current value of Scale
18.27.7.Scale properties setting in constructorScale properties setting in constructor