tags:

views:

18

answers:

1

This code works fine and produces checkbuttons in a long long list.

def createbutton(self,name):
    var = IntVar()
    account = name[0]
    chk = Checkbutton(self.root, text=account, variable=var)
    chk.pack(side = BOTTOM)
    self.states.append((name,var))

The problem is that the list of buttons is so long, that it stretches farther then the length of my screen so i want to put them into a grid, so that i can have maybe 10 checkbuttons in a column. Just to test the capability, i did this:

def createbutton(self,name):
    var = IntVar()
    account = name[0]
    chk = Checkbutton(self.root, text=account, variable=var)
    chk.grid(column=0)
    self.states.append((name,var))

And nothing happens, no tk interface opens and the program just waits. Please help!

+1  A: 

Is it possible that you have other widgets that are in the root window, and they are put there using pack? If you try to use pack and grid in the same container your app can go into an infinite loop as each manager struggles for control of the container.

Bryan Oakley
You are absolutely right. I figured that out before you posted. I had a .pack in other code that was causing that to happen. Thank you!!
Alex