I'm confused on how i can change or "toggle" the text of a button from say "D" to "A" when clicked, and then back to "D" if clicked again. So far I have this:
from Tkinter import *
from tkFileDialog import *
class Game(Frame):
def __init__(self,root):
Frame.__init__(self,root)
self.grid()
self.buttons()
def buttons(self):
for x in range(10):
for y in range(10):
self.liveButton = Button (self, text="D", width=5)
self.liveButton.grid(row=x,column=y)
def main():
root = Tk()
root.title("Sample Application")
root.geometry("150x150")
Game(root)
root.mainloop()
main()