I am beginning to write a tkinter program that will generate a DnD 3.5 Character Sheet.
I haven't gotten very far.
I'm using Python 3, and for some reason the sticky option of the .grid() method isn't working. When I run the code below, I get an error that says:
unknown option "-sticky"
At first I thought that maybe sticky had been renamed from Python 2, but I couldn't find any indication of this.
I must be doing something wrong, but I can't figure out what. It works fine when I leave out the sticky option, but it just looks silly.
I appreciate any help,
~MoosePasteInventor
from tkinter import *
class DnD35:
def __init__(self, parent):
self.DnDFrame = Frame(parent)
self.DnDFrame.grid()
self.playerInfo = Frame(parent)
self.playerInfo.grid(in_=self.DnDFrame, column=0, row=0)
self.VitalStats = Frame(parent)
self.VitalStats.grid(in_=self.DnDFrame, column=0, row=1)
self.playerLabel = Label(self.playerInfo, text="Player:", relief=GROOVE, sticky=E)
self.playerLabel.grid(in_=self.playerInfo, column=0, row=0)
self.playerEntry = Entry(self.playerInfo)
self.playerEntry.grid(in_=self.playerInfo, column=1, row=0)
self.nameLabel = Label(self.VitalStats, text="Name:", relief=GROOVE, sticky=E)
self.nameLabel.grid(in_=self.VitalStats, column=0, row=0)
self.nameEntry = Entry(self.VitalStats)
self.nameEntry.grid(in_=self.VitalStats, column=1, row=0)
self.ageLabel = Label(self.VitalStats, text="Age:", relief=GROOVE, sticky=E)
self.ageLabel.grid(in_=self.VitalStats, column=2, row=0)
self.ageEntry = Entry(self.VitalStats)
self.ageEntry.grid(in_=self.VitalStats, column=3, row=0)
self.raceLabel = Label(self.VitalStats, text="Race:", relief=GROOVE, sticky=E)
self.raceLabel.grid(in_=self.VitalStats, column=4, row=0)
self.raceEntry = Entry(self.VitalStats)
self.raceEntry.grid(in_=self.VitalStats, column=5, row=0)
self.heightLabel = Label(self.VitalStats, text="Height:", relief=GROOVE, sticky=E)
self.heightLabel.grid(in_=self.VitalStats, column=0, row=1)
self.heightEntry = Entry(self.VitalStats)
self.heightEntry.grid(in_=self.VitalStats, column=1, row=1)
self.weightLabel = Label(self.VitalStats, text="Weight:", relief=GROOVE, sticky=E)
self.weightLabel.grid(in_=self.VitalStats, column=2, row=1)
self.weightEntry = Entry(self.VitalStats)
self.weightEntry.grid(in_=self.VitalStats, column=3, row=1)
self.sizeLabel = Label(self.VitalStats, text="Size:", relief=GROOVE, sticky=E)
self.sizeLabel.grid(in_=self.VitalStats, column=4, row=1)
self.sizeEntry = Entry(self.VitalStats)
self.sizeEntry.grid(in_=self.VitalStats, column=5, row=1)
self.languagesLabel = Label(self.VitalStats, text="Languages:", relief=GROOVE, sticky=NE)
self.languagesLabel.grid(in_=self.VitalStats, column=0, row=2)
self.languagesText = Text(self.VitalStats, height=5, width=20)
self.languagesText.grid(in_=self.VitalStats, column=1, row=2)
self.racialLabel = Label(self.VitalStats, text="Racial Traits:", relief=GROOVE, sticky=NE)
self.racialLabel.grid(in_=self.VitalStats, column=2, row=2)
self.racialText = Text(self.VitalStats, height=5, width=40)
self.racialText.grid(in_=self.VitalStats, column=3, row=2, columnspan=3)
root = Tk()
root.title("DnD35")
myapp = DnD35(root)
root.mainloop()