Label, Button, and Scale Demo : Scale « Tkinker « Python Tutorial






Label, Button, and Scale Demo
from Tkinter import *

def resize(ev=None):
    label.config(font='Helvetica -%d bold' % scale.get())

top = Tk()
top.geometry('250x150')

label = Label(top, text='Hello World!',font='Helvetica -12 bold')
label.pack(fill=Y, expand=1)

scale = Scale(top, from_=10, to=40,orient=HORIZONTAL, command=resize)
scale.set(12)
scale.pack(fill=X, expand=1)

quit = Button(top, text='QUIT',command=top.quit, activeforeground='white',activebackground='red')
quit.pack()

mainloop()








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