Hi everyone. Let me start by saying I have managed to learn quite a few things and solve pretty much any python problems using this site. So thanks to everyone who contributes to these forums. Now for my problem. I am having a hard time getting the .grid method to work with a particular radiobutton setup in tkinter.
class App(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.initialize()
def initialize(self):
ODDS = [
('item1', 1),
('item3', 3),
('item5', 5),
('item7', 7),
('item9', 9),
('item11', 11),
('item13', 13),
('item15', 15),
]
for text, mode in ODDS:
self.itemOdds = Tkinter.Radiobutton(self, text=text,
variable=self.itemVar, value=mode)
self.itemOdds.grid(column=0)
EVENS = [
('item0', 0),
('item2', 2),
('item4', 4),
('item6', 6),
('item8', 8),
('item10', 10),
('item12', 12),
('item14', 14),
]
for text, mode in EVENS:
self.itemEvens = Tkinter.Radiobutton(self, text=text,
variable=self.itemVar, value=mode)
self.itemEvens.grid(column=1)
if __name__ == "__main__":
app = App(None)
app.title()
app.geometry('+100+70')
app.mainloop()
When I do this rather than getting the two sets of buttons side by side, like this:
1....... 2..........
3....... 4..........
They end up offset like this:
1.......
3.......
*************2.........
*************4.........
I have tried every option I can think of using grid. When I add the normal buttons for selection, to try and force the grid manager to push the radiobutton widget up, the normal buttons are just laid over the top of the radio buttons. Anyone have any ideas how to get grid to behave properly?