Scrollbar in xview in custom tkinter

Question:

How can I set the scrollbar in XView in custom Tkinter?

Scrollbar orientation is not working in horizontal view.

Asked By: Aavez siddiqui

||

Answers:

import customtkinter as ctk
import tkinter as tk
root = ctk.CTk()

frame = ctk.CTkFrame(master=root)
frame.place(relx=0.5,width=300 ,height=200 ,anchor='n')
x_sroller = ctk.CTkScrollbar(master=frame ,orientation='horizontal')
x_sroller.pack(side='bottom')
text_box = tk.Listbox(master=frame ,xscrollcommand=x_sroller.set)
text_box.place(width=300 ,height=150 ,y=30)
x_sroller.configure(command=text_box.xview)
text_box.insert('end'," ".join([str(x) for x in range(1000)]))

root.mainloop()
Answered By: Thisal

For customtkinter keyword is orient.

window = Tk()
frame1 = Frame(window)
scrollbar = Scrollbar(frame1, orient='horizontal')
Answered By: toyota Supra
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.