title: Why don't the buttons change color when i click them?
body: <p>My code isn't giving me what i want. When i click it, it turns blue until let go and then turns back to white. I want the buttons to change colour when they're clicked. So if i click it once, i want it to change to blue. And if i click it again, change from blue to red, and do this for 6 total colors (white, blue, green, red, orange, yellow)(white is the starting color).</p>
  
  <p>I'm new to python coding and to be honest, it's not all my code, so i don't know what its doing. I've looked through the code to see what i can make of it.  I've also researched my question heaps but still can't find answers. This is a part of the code that i think has the problem in it. This is only the first side (of the rubik's cube) so what ever the response/answer/correction, i''l make to the 5 other sides as well...</p>
  
  <pre><code>def enter_yellow_face():
      top,mid,btm=[0,0,0],[0,0,0],[0,0,0]
      bord = [top,mid,btm]
      counter = [0, 0, 0,
                 0, 0, 0,
                 0, 0, 0]
  
  def change_color(x, b=bord):
      # seems like x is the square number out of the 9 squares
      #global counter
      r=x/3
      c=x%3
      if b[r][c] == 0:
          b[r][c]= 5
          bb[x].ss.configure(bg='white', activebackground='white')
          counter[x] = 0
          yellow_face[x] = 'w'
  
      elif counter[x] == 0:
          bb[x].ss.configure(bg='blue', activebackground='blue')
          counter[x] = 1
          yellow_face[x] = 'b'
  
      elif counter[x] == 1:
          bb[x].ss.configure(bg='red', activebackground='red')
          counter[x] = 2
          yellow_face[x] = 'r'
  
          ### keep following the cycle of white-yellow-red...
      elif counter[x] == 2:
          bb[x].ss.configure(bg='green', activebackground='green')
          counter[x] = 3
          yellow_face[x] = 'g'
  
      elif counter[x] == 3:
          bb[x].ss.configure(bg='orange', activebackground='orange')
          counter[x] = 4
          yellow_face[x] = 'o'
  
      elif counter[x] == 4:
          bb[x].ss.configure(bg='yellow', activebackground='yellow')
          counter[x] = 5
          yellow_face[x] = 'y'
  
      elif counter[x] == 5:
          bb[x].ss.configure(bg='white', activebackground='white')
          counter[x] = 0
          yellow_face[x] = 'w'
  
  root = Tk()
  root.title('Enter Yellow Face')
  
  class Knop():
      """This is the docstring of the class"""
  
      def __init__(self, i, master=None):
          self.nummer = i
          self.row = i/3
          self.col = i%3
          def human_move():
              change_color(self.nummer)
          self.ss = Button(root, command=human_move, bg='yellow', activebackground='yellow', width=10, height=5)
          self.ss.grid(row=self.row, column=self.col)
  
          next_face = Button(root, text="Next Face",  command=root.destroy)
          next_face.grid(row=4, column=1)
  
  bb = range(9)
  for i in range(9):
      bb[i]= Knop(i, master=root)
  
  mainloop()
  </code></pre>
  
  <p>I thought that this would create a popup window that displayed boxes that when clicked would give me different colours. Like starting with white, when i click i though it would change to blue. and if i clicked the now blue box, it would change to red. But when i run it, it actually turns blue and back to white once i let go of the click.</p>