Link to home
Start Free TrialLog in
Avatar of drewmore44

asked on

Python tkinter

I'm using the following loop to create a button for every object in an array.

        r = roster
        for x in r.roster:
            c = Button(self.Namebox, text=(x.firstname, x.lastname), 
                                                        command = lambda y = x: SetAvail(y))
            c.grid(in_ = self.Namebox)

Open in new window

It works fine, but my problem is that there are more objects in the array than will fit on the screen vertically. How do I get it to go to a new column after stacking 15 buttons??

Alternatively, I figured I could attach a scrollbar to the canvas on which the buttons are being placed, which seems like it'd be simple but has proved highly difficult. I've gotten the scrollbar to appear, but it is really short and grey/cannot be clicked.
Avatar of clockwatcher

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial