'Can't get listbox and scrollbar to fit frame
I have 2 canvases stacked on top of one another and placed a frame to the side but i cant seem to get my listbox and frame to fill it entirely
Here's my code:
from tkinter import *
root = Tk()
root.minsize(1000,600)
root.maxsize(1000,600)
size1 = Canvas(root,width = 800, height= 310, bg = '#42f5a1', highlightthickness=0, borderwidth=0)
#size1.pack(anchor=NW)
size1.grid(row = 0, column = 0)
size2 = Canvas(root, width = 800, height = 290, bg = "grey", highlightthickness=0, borderwidth=0)
#size3.pack(anchor=SW)
size2.grid(row = 1, column = 0)
f = Frame(root, bd = 10, width = 200, height = 600, bg = "blue")
#f.pack(side = RIGHT, fill=BOTH)
f.grid(row = 0, column = 1, rowspan=2)
listbox = Listbox(f, highlightthickness=0, borderwidth=0)
listbox.pack(side = LEFT, fill = BOTH, expand = TRUE)
#listbox.place(x = 800, y = 0)
scrollbar = Scrollbar(f)
scrollbar.pack(side = RIGHT, fill = BOTH, expand = TRUE)
for values in range(100):
listbox.insert(END, values)
listbox.config(yscrollcommand = scrollbar.set)
scrollbar.config(command = listbox.yview)
root.mainloop()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

