title: How can I change backgroundcolor of button depending on current color with Python?
body: <p>I'm a completely new Python-developer, so please do not make it too complicated.
  I've made with tkinter a grid with 9 buttons, which should change their backgroundcolor depending on the current color. If the current color is white, the color should change to red. If the color is red, it should change back to white.</p>
  <p><code>led0_btn = Button(fenster, text = &quot;led0&quot;, height = h, width = w,highlightbackground = &quot;white&quot;, command=btn0)</code></p>
  <pre><code>def btn0():
  if led0_btn.highlightbackground == &quot;white&quot;:
      led0_btn.configure(highlightbackground = &quot;red&quot;)
  </code></pre>
  <p>That's how I tried to do it. But if I do it, I get an this:</p>
  <blockquote>
  <p>File &quot;CodeGeneratorBeta.py&quot;, line 9, in btn0<br />
  if led0_btn.highlightbackground == &quot;white&quot;:<br />
  AttributeError: Button instance has no attribute 'highlightbackground'</p>
  </blockquote>
  <p>Can somebody help me?</p>