Created
June 3, 2024 21:02
-
-
Save vigilantPotato/40eab1387b35f33153617750bfee79d9 to your computer and use it in GitHub Desktop.
How to use scale widget_1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import tkinter | |
if __name__ == "__main__": | |
ctypes.windll.shcore.SetProcessDpiAwareness(1) | |
root = tkinter.Tk() | |
#variable | |
var = tkinter.IntVar(root) | |
#Label | |
label = tkinter.Label( | |
root, | |
textvariable=var, #set variable | |
relief="ridge", | |
) | |
label.pack() | |
#Scale_vertical | |
scale = tkinter.Scale( | |
root, | |
variable=var, #set variable | |
) | |
scale.pack() | |
#Scale_horizonal | |
scale_h = tkinter.Scale( | |
root, | |
variable=var, #set variable | |
orient="horizontal", | |
) | |
scale_h.pack() | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment