Hey, when I execute the following code I get "App instance has no attribute rolls" I have no clue as to why this is and any help would be awesome, Thanks.
import Tkinter
class App:
def __init__(self, master):
self.sticky_all = Tkinter.N+Tkinter.W+Tkinter.E+Tkinter.S
self.frame = Tkinter.Frame(master)
self.frame.pack()
# Dice Buttons.
self.bd4 = Tkinter.Button(self.frame, text="D4", command = self.roll_dice()) # Button for D4.
# Text Field.
self.rolls = Tkinter.Text(self.frame, width=15, height=1)
self.rolls.tag_configure("center", justify='center')
# Grid.
self.rolls.grid(row=0, column=1)
self.bd4.grid(row=0, column=0)
def roll_dice(self):
self.rolls.insert('end', 'text', 'center')
root = Tkinter.Tk()
app = App(root)
root.mainloop()