title: Styling ttk button borders
body: <p>I'm trying to figure out how to style ttk buttons from Python (<a href="http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-Button.html" rel="noreferrer">ttk.Button</a>)
   on Linux, and right now I'm focusing on the border. All of the built-in themes (<em>alt</em>, <em>clam</em>, <em>classic</em>, and <em>default</em>) appear to use the <em>Button.border</em> element, but they list differing options and don't necessarily appear to support some listed options.</p>
  
  <ul>
  <li><p><em>alt</em> lists <em>-background</em>, <em>-bordercolor</em>, <em>-default</em>, <em>-borderwidth</em>, and <em>-relief</em>. However, <em>-bordercolor</em> is ignored.</p></li>
  <li><p><em>clam</em> lists <em>-bordercolor</em>, <em>-lightcolor</em>, <em>-darkcolor</em>, <em>-relief</em>, and <em>-borderwidth</em>. However, <em>-borderwidth</em> is ignored.</p></li>
  <li><p><em>classic</em> lists <em>-background</em>, <em>-borderwidth</em>, <em>-relief</em>, and <em>-default</em>.</p></li>
  <li><p><em>default</em> lists <em>-background</em>, <em>-borderwidth</em>, and <em>-relief</em>.</p></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/3i3wx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3i3wx.png" alt="Button borders across themes"></a></p>
  
  <p>Why is it that for the <em>Button.border</em> element only <em>clam</em> supports <em>-bordercolor</em>, <em>-lightcolor</em>, and <em>-darkcolor</em>, and only the others support <em>-borderwidth</em>? Shouldn't all of the themes support all of those options?</p>
  
  <p>I'm by no means proficient in reading Tcl, but I don't see anything in the ttk theme files (<a href="https://github.com/tcltk/tk/blob/master/library/ttk/altTheme.tcl" rel="noreferrer">altTheme.tcl</a>, <a href="https://github.com/tcltk/tk/blob/master/library/ttk/clamTheme.tcl" rel="noreferrer">clamTheme.tcl</a>, <a href="https://github.com/tcltk/tk/blob/master/library/ttk/classicTheme.tcl" rel="noreferrer">classicTheme.tcl</a>, <a href="https://github.com/tcltk/tk/blob/master/library/ttk/defaults.tcl" rel="noreferrer">defaults.tcl</a>) that indicate the <em>Button.border</em> element is customized or any reference to it at all. There's only some <em>configure</em> and <em>map</em> calls for the <em>TButton</em> style.</p>
  
  <hr>
  
  <p>This is the code I used to view the results above:</p>
  
  <pre><code>import pprint
  import tkinter as tk
  import tkinter.ttk as ttk
  
  def theme_changed(theme):
      style.theme_use(theme)
  
      print(theme)
      pprint.pprint(style.layout('TButton'))
      pprint.pprint(style.element_options('Button.border'))
  
      style.configure(
          'Custom.TButton',
          background='#FFFFFF', # White
          bordercolor='#00FF00', # Green
          lightcolor='#FF0000', # Red
          darkcolor='#0000FF', # Blue
          borderwidth=4,
          foreground='#00FFFF', # Cyan
      )
  
  root = tk.Tk()
  style = ttk.Style()
  
  combo = ttk.Combobox(root, values=sorted(style.theme_names()), state='readonly')
  combo.set(style.theme_use())
  combo.bind('&lt;&lt;ComboboxSelected&gt;&gt;', lambda _e: theme_changed(combo.get()))
  combo.pack()
  
  theme_changed(style.theme_use())
  
  button = ttk.Button(root, text="Normal Button")
  button.pack()
  
  button = ttk.Button(root, style="Custom.TButton", text="Custom Button")
  button.pack()
  
  root.mainloop()
  </code></pre>