I'm writting a evaluation interface in python (tkinter) and I want to put an toll like a scrollbar that allow the user to put the scroll in a desired position in the range of the bar, and after that I want to quantify this position to save the evaluation of the user.
Putting in another words, what I want to do is basically a volume (sound) bar from Windows that saves the especific value.
I tried to use the Scrollbar function, but without sucess. Just a link for a function that work as I want is enough
janela = Tk()
janela.geometry("800x150")
janela.title("MSE - Diagnose Acústica")
janela.eval('tk::PlaceWindow . center')
#second_win = Toplevel(janela)
#janela.eval(f'tk::PlaceWindow {str(second_win)} center')
controls_frame2 = Frame(janela)
controls_frame2.pack()
controls_frame = Frame(janela)
controls_frame.pack()
controls_frame3 = Frame(janela)
controls_frame3.pack()
botao_good_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\thumbs-up.png")
botao_good = Button(controls_frame, image=botao_good_img, borderwidth=0, text="APROVADO", command=lambda: next_motor(classif=4, wavelist=wave_list, self= janela))
botao_good.grid(column=1, row=2, padx=10)
botao_bearing_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\ball-bearing.png")
botao_bearing = Button(controls_frame, image=botao_bearing_img, borderwidth=0, text="ROLAMENTO", command=lambda: next_motor(classif=0, wavelist=wave_list, self= janela))
botao_bearing.grid(column=2, row=2, padx=10)
botao_tape_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\tape.png")
botao_tape = Button(controls_frame, image=botao_tape_img, borderwidth=0, text="FITA", command=lambda: next_motor(classif=2, wavelist=wave_list, self= janela))
botao_tape.grid(column=3, row=2, padx=10)
botao_poliester_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\fabric.png")
botao_poliester = Button(controls_frame, image=botao_poliester_img, borderwidth=0, text="POLIESTER", command=lambda: next_motor(classif=1, wavelist=wave_list, self= janela))
botao_poliester.grid(column=4, row=2, padx=10)
botao_yarn_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\yarn.png")
botao_yarn = Button(controls_frame, image=botao_yarn_img, borderwidth=0, text="BARBANTE", command=lambda: next_motor(classif=3, wavelist=wave_list, self= janela))
botao_yarn.grid(column=5, row=2, padx=10)
botao_other_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\more-information.png")
botao_other = Button(controls_frame, image=botao_other_img, borderwidth=0, text="OUTROS", command=lambda: next_motor(classif=5, wavelist=wave_list, self= janela))
botao_other.grid(column=6, row=2, padx=10)
botao_play_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\play.png")
botao_play = Button(controls_frame2, borderwidth=0, image=botao_play_img, command=lambda: play(paused, wavelist=wave_list))
botao_play.grid(column=0, row=0, padx=30)
botao_pause_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\pause-button.png")
botao_pause = Button(controls_frame2, borderwidth=0, image=botao_pause_img, command=lambda: pause(paused))
botao_pause.grid(column=1, row=0, padx=30)
botao_repeat_img = PhotoImage(file=r"C:\Users\dtoniato\PycharmProjects\MSE_Diagnose\images\repeat.png")
botao_repeat = Button(controls_frame2, borderwidth=0, image=botao_repeat_img, command= lambda: repeat())
botao_repeat.grid(column=2, row=0, padx=30)
texto = "Em andamento: "+str(aux+1)+"/"+str(len(wave_list))
texto_andamento = Label(controls_frame2, text=texto)
texto_andamento.grid(column=1, row=15, pady=10)
w = Scrollbar(controls_frame3, orient=HORIZONTAL, width=15)
w.grid(column=1, row=20, pady=10)
janela.mainloop()