I am trying to make a program that will make python easier using OOP, and when I tried to make a horizontal scrollbar. It did not end well
This is my code for the scrollbar:
def add_scrollbar(self, pos1, pos2, orientation, List):
orientation = orientation.upper()
if orientation == "HORIZONTAL":
scrollbar = Scrollbar(self.Created_Window, orient=HORIZONTAL)
scrollbar.pack(side=RIGHT, fill=Y)
elif orientation == "VERTICAL":
scrollbar = Scrollbar(self.Created_Window, orient=VERTICAL)
scrollbar. Pack(side=RIGHT, fill=Y)
mylist = Listbox(self.Created_Window, yscrollcommand=scrollbar.set)
for line in range(len(List)):
mylist.insert(END, List[line])
mylist.place(x=pos1, y=pos2)
scrollbar.config(command=mylist.yview)
This the main testing file code:
import My Previous code file
Ls = ["line1", "line2", "line3", "line4", "line5", "line6", "line7", "line8"]
easyF = My Previous code file.MyClass()
easyF.create_window("test", "100x100")
easyF.add_scrollbar(250, 250, "horizontal", Ls)
easyF.start_window()
This is the image for what happened
[](https://i.stack.imgur.com/3puvK.jpg)
Any ideas why?