Formatting dilema using Grid option

Marc mnations at airmail.net
Fri Mar 22 14:48:45 EST 2002


I am trying to lay things out with a grid. Here is the code I have
right now:

...
for testgroup, titles, groupRow, groupCol in testGroups:
			self.newGroup = Pmw.Group(modFrame, tag_text=titles)
			for module, row, col, status, color in testgroup:
				setattr( self.modVar, module, IntVar() )
				self.modButton = Checkbutton(self.newGroup.interior(),
text=module, state=status, anchor=W,
					variable = getattr( self.modVar, module)).grid(row=row, col=col,
sticky=W )
			self.newGroup.grid(row=groupRow, col=groupCol, sticky=NSEW )
...

Basically I have two lists of tuples, testGroups and another list
contained in testGroups.All of this works very nicely and I get the
layout almost like I want. It more or less looks like this:

aaaabbbbcccc
bbbbccccaaaa
ccccaaaabbbb

The only problem is that all of the groups are centered in the middle.
The elements in the groups are checkboxes that I want to be aligned on
the left side of the boxes. I've fiddled around with as many different
options as possible, and finally got the boxes to be equal sizes
within the grid. However, I just can't pull everything to the left
side of the boxes. How can I do this?

Thanks,
Marc



More information about the Python-list mailing list