Skip to content
Advertisement

I can’t scroll grids in frames in canvas (tkinter)

I am using Tkinter for a project, and I found in Stackoverflow a code to create a scrollbar, which I understood well. I wanted to scroll some buttons, which worked, but now when I try to scroll some grids (button and scales), it doesn’t work.

I have tried to manage my code with answers here and here, but I didn’t reach my goal!

JavaScript

EDIT 1: It seems that the output is just made of the last grid, because the text in the only button shown is ff, which corresponds to the last sound in the list. I didn’t have this problem with just buttons (and not grids): I could see every sounds and I had the scrolling bar active…

EDIT 2: The problem is solved, but now we have a new problem : putting a command to the checkbutton isn’t possible like that. You can see by yourself that the self.varbutton.set(“OFF) isn’t respected, the button is always on “ON”… Here is the code with the problem of command :

JavaScript

EDIT 3: I edited my second code (see EDIT 2).

Advertisement

Answer

It is because you put all the set of Scale and Checkbutton into same location, so the last set will overlap the previous ones:

JavaScript

You should put the set of widgets in a frame and use pack() on the frame:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement