Skip to content

Instantly share code, notes, and snippets.

@vigilantPotato
Created June 3, 2024 21:02
Show Gist options
  • Save vigilantPotato/40eab1387b35f33153617750bfee79d9 to your computer and use it in GitHub Desktop.
Save vigilantPotato/40eab1387b35f33153617750bfee79d9 to your computer and use it in GitHub Desktop.
How to use scale widget_1
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