Tkinter Tix Checklist Hlist Header Configuration Options
<p>I'm hoping a tcl/tk expert can help answer this super-niche question regarding a <strong>Tix CheckList Hlist Header</strong>.  All I want to do is change the background color from an ugly gray to white.</p>

<p>I find it very difficult to even know what options (<code>cnf={}</code> or <code>**kw</code>) I can use for ANYTHING in tix. I have discovered that I can do <code>self.checklist.hlist.config().keys()</code> which returns:</p>

<pre><code>['background', 'bd', 'bg', 'borderwidth', 'browsecmd', 'columns', 'command',
 'cursor', 'dragcmd', 'drawbranch', 'dropcmd', 'fg', 'font', 'foreground',
 'gap', 'header', 'height', 'highlightbackground', 'highlightcolor',
 'highlightthickness', 'indent', 'indicator', 'indicatorcmd', 'itemtype',
 'padx', 'pady', 'relief', 'selectbackground', 'selectborderwidth',
 'selectforeground', 'selectmode', 'separator', 'sizecmd', 'takefocus',
 'wideselection', 'width', 'xscrollcommand', 'yscrollcommand']
</code></pre>

<p>I don't know how to do this for the <strong>actual header object</strong> to see what options are available.</p>

<p>This is what it looks like:</p>

<p><a href="http://i.stack.imgur.com/1oxeu.png" rel="nofollow"><img src="http://i.stack.imgur.com/1oxeu.png" alt="Tix CheckList Hlist Header"></a></p>

<p>Here's the code that creates it:</p>

<pre><code>import tkinter as tk
from tkinter import tix

class whatever(tk.Frame):
  def __init__(self, parent):
    super(whatever, self).__init__(parent)
    self.parent = parent

    self.checklist = tix.CheckList(self.parent, browsecmd=self.selectItem,
                                   options='hlist.columns 1', highlightthickness=1,
                                   highlightcolor='#B7D9ED')
    self.checklist.grid(sticky='ew', padx=20)

    self.checklist.hlist.config(bg='white', bd=0, selectmode='none', selectbackground='white',
                                selectforeground='black', drawbranch=True, pady=5, header=True)

    self.checklist.hlist.header_create(0, itemtype=tix.TEXT, text='My Heading Text',
                                       relief='flat')

    self.checklist.hlist.add("CL1", text="checklist1")
    self.checklist.hlist.add("CL1.Item1", text="subitem1")
    self.checklist.setstatus("CL1", "on")
    self.checklist.setstatus("CL1.Item1", "off")

  def selectItem(self, item):
      print(item)

root = tix.Tk()
whatever(root)
root.mainloop()
</code></pre>

<p><strong>Additional info</strong>:</p>

<p>By the way, I'm mainly using this site to figure out what methods are available for <code>hlist</code> - <a href="http://epydoc.sourceforge.net/stdlib/Tix.HList-class.html" rel="nofollow">http://epydoc.sourceforge.net/stdlib/Tix.HList-class.html</a></p>

<p>This example was helpful too: <a href="https://svn.python.org/projects/stackless/trunk/Demo/tix/samples/SHList2.py" rel="nofollow">https://svn.python.org/projects/stackless/trunk/Demo/tix/samples/SHList2.py</a></p>

<p><strong>What Have I Tried...</strong></p>

<p>Lots of things for hours on-end. I think this should be in:</p>

<pre><code>self.checklist.hlist.header_configure(0, background='white')
</code></pre>

<p>but I've tried: <code>background</code>, <code>selectbackground</code>, <code>bg</code>, <code>color</code> ... and more. They all end with the same <code>_tkinter.TclError: unknown option "-NAMEHERE"</code>message.</p>

<p>Simply, add <code>headerbackground</code> parameter to <code>header_create()</code> method:</p>

<pre><code>...
self.checklist.hlist.header_create(0, itemtype=tix.TEXT, text='My Heading Text', 
headerbackground="red", relief='flat')
...
</code></pre>

python tkinter checklistbox hlist tix