I have 2 listboxes, side by side, and I'd like each to have a scrollbar. The issue I am running into is that when the listboxes are empty, they do not appear, I can only see the scrollbar.
Code below is for just one listbox. When I comment-out self.scrollbar.config and self.scrollbar.grid, I see my 20x10 listbox. When those are back in the code, as below, I only see the scrollbar. I need the listbox to remain fixed size and fill up as per the rest of my code..Screenshot: http://i.imgur.com/jQWg4d2.jpg
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.grid(sticky=N+S+E+W)
self.mainframe()
def mainframe(self):
self.lb = Listbox(self, width=20, height=10, bg='yellow', fg='blue')
self.scrollbar = Scrollbar(self.lb, orient=VERTICAL)
self.lb.config(yscrollcommand=self.scrollbar.set)
self.scrollbar.config(command=self.lb.yview)
self.lb.grid(row=0, column=0)
self.scrollbar.grid(column=2)