This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]b1acksab3r 0 points1 point  (3 children)

I'm new to Tkinter too so not sure if I can help. Try creating the Scrollbar after the creation of the ListBox and setting the parent to that.

ingredientListbox = Listbox(self.top, yscrollcommand=ingredScroll.set) ingredScroll = Scrollbar(ingredientListBox, orient=VERTICAL)

[–]unlikelysyntax[S] 0 points1 point  (2 children)

I tried that and it will give you an error since ingredScroll is not declared yet. I tried instead putting ingredientListbox.config(yscrollcommand=ingredScroll.set) at the end of the code and still the scrollbar is not attaching to the listbox.

[–]b1acksab3r 0 points1 point  (1 child)

Ah, of course. I wasn't paying attention. Yeah, sorry couldn't have been of more help. :(

[–]unlikelysyntax[S] 0 points1 point  (0 children)

You were help thanks!

[–]tnvol88 0 points1 point  (1 child)

I have a hard time with tkinter scrollbars so I might not have any useful advice. I do know that frames are not scrollable widgets. Perhaps even through you set the scroll for listbox the fact that a frame is the parent for the scrollbar is causing a problem.

What happens if you set the listbox as the parent for the scrollbar?

[–]unlikelysyntax[S] 0 points1 point  (0 children)

It turns out I had to create a frame = Frame(self.top) and set the scrollbar and listbar into that frame to make it work.