[Tkinter-discuss] Still don't understand ttk styling

John W. Shipman john at nmt.edu
Thu Dec 6 23:07:35 CET 2012

I've read and reread everything I can find about ttk, both in
the Tcl docs and the Python 2.7 library docs, and I still have
no idea how styling really works.

Just to focus the discussion, here's a very simple task: change
the font that appears on the tabs in the ttk.Notebook widget.

The only way I found to do this is to change the root style's
default like this:

     s = ttk.Style()
     s.configure('.', font=('Helvetica', 16, 'bold'))

Is this the only way I can style the tab font?  If not, can
someone please explain how you figure out where Notebook
gets its font, and how to change it?

I've used all the methods of ttk.Style that one uses to explore
the structure of a theme: .theme_names(), .element_names(),
.element_options(), .lookup(), .configure(), and .layout().
All this tells me is that a Notebook has only one element,
named Notebook.client.

I understand that any option not configured in Notebook.client
falls back to the "client" theme element.  However, both those
elements have only two attributes, 'background' and
'borderdwidth'.  Nothing about a font attribute.

Most grateful for any help that you might provide, I remain,
John Shipman (john at nmt.edu), Applications Specialist
New Mexico Tech Computer Center, Speare 146, Socorro, NM 87801
(575) 835-5735, http://www.nmt.edu/~john
   ``Let's go outside and commiserate with nature.''  --Dave Farber

P.S.  I'm well along on the ttk rewrite of our locally written
Tkinter manual.  The rest of what's left looks pretty
straightforward, but I won't be happy with this version unless it
can help people answer simple questions like the one posed here.
The draft is here if you don't mind big chunks still missing:


Once it's done I'll move this version to the URL that is
referenced several places around the web, which currently holds
the 8.4, non-ttk version:


More information about the Tkinter-discuss mailing list