1 #Gui:tkinter Use2 #Change the font size in a label by adjusting the scroll bar3 ImportTkinter as TK4 5 6 defResize (ev=None):7 " "change the label font size" "8Label.config (font='Helvetica-%d Bold'%scale.get ())9 Ten Onetop = tk. Tk ()#instantiating a Tkinter object ATop.geometry ('250x150')#Set Window Size -Top.title ('Slide Settings')#Set Window caption - the #Label Control -label = Tk. Label (Top, text='Hello World', font='Helvetica-12 Bold') -Label.pack (FILL=TK. Y, expand=1) - + #Scale scroll bar, values from 10 to 40, horizontal swipe, callback resize function -Scale = Tk. Scale (top, from_=10, to=40, ORIENT=TK. Horizontal, command=resize) +Scale.set (25)#set the initial value AScale.pack (FILL=TK. X, expand=1) at - #Button Control -Quit_btn = Tk. Button (Top, text='QUIT', command=Top.quit, -Activeforeground=' White', activebackground='Red') - Quit_btn.pack () - inTk.mainloop ()
:
Python's tkinter use-scroll bar