Home > front end >  Why orientation parameter doesn't exists in Slider?
Why orientation parameter doesn't exists in Slider?

Time:11-30

Hi have this small code for practice using CustomTkinter, reading the official documentation for a vertical slider i need to write orientation = 'vertical' but when i run the code Py charm says "_tkinter.TclError: unknown option "-orientation", how is possible that orientation isn't a parameter? I can't understand please help me, the code:

from tkinter import *
import customtkinter
def slider(valore):
    valore = round(valore,1)
    print(valore)
win = Tk()
slider = customtkinter.CTkSlider(master=win, from_=0, to=100, command=slider,fg_color='#555555',progress_color='#144870')
slider.configure(orientation='vertical')
slider.pack(padx=100,pady=100)
win.mainloop()

CodePudding user response:

Comment out line 8. Add this parameter orient=Tk.Vertical.

slider = customtkinter.CTkSlider(master=win, from_=0, to=100,orient=Tk.Vertical, command=slider,fg_color='#555555',progress_color='#144870')
  • Related