title: callback function not defined
body: <p>I'm trying to learn how to make GUI with tkinter in Python and I'm getting an error that my callback function is undefined. Basically I want a grid of white squares and when you click on the square it will become red.</p>
  
  <pre><code>from tkinter import *
  
  root = Tk()
  
  class Application(Frame):
      def __init__(self, master, *args, **kwargs):
          Frame.__init__(self, master, *args, ** kwargs)
          self.createWidgets()
  
      def mouse_click(self):
          self.squares.bg = 'red'
  
      def createWidgets(self):
          for i in range(10):
              for j in range(10):
                  self.squares = Button(self, height = 3, width = 7, bg = 'white',
                                        command = lambda: mouse_click())
                  self.squares.grid(row = i, column = j)
  
  Application(root).grid()
  root.mainloop()
  </code></pre>