petro4213
petro4213

Reputation: 163

Is there any comprehensive ttk styling documentation out there

I'm working with ttk widgets and want to use the styling options. While I can find documentation about various dynamic states and various options, it is always hard to find out which option does what.
Take e.g. the Combobox. There are lots of styling options like

-arrowcolor color
-arrowsize amount
-background color
-bordercolor color
-darkcolor color
-focusfill color
-foreground color
-fieldbackground color

Can only be changed when using non-native and non-graphical themes.
-insertcolor color
-insertwidth amount
-lightcolor color
-padding padding
-placeholderforeground color
-postoffset padding
-selectbackground color  (Text entry select background)
-selectforeground color  (Text entry select foreground)

but for many items it's hard to tell, what they mean and I can't find any docs about that. I can only try out, which can be quite hard with complex widgets as a combo-box, which not only has various elements, but also quite some dynamic states.

I'm running mad, because I only can find pages, which either show only very simplified examples or just name the options and don't tell what they are for (like e.g. https://www.tcl.tk/man/tcl8.7/TkCmd/ttk_combobox.html, which the above list is from and looks like the definitive source of information of that kind, but it is so limited...)

Is there really no decent doc about ttk styling out there?

Upvotes: 0

Views: 1252

Answers (2)

Ather Shahbaz
Ather Shahbaz

Reputation: 11

There is tutorial TK Docs Tutorial on TKDocs which explain most of options and I found it quite useful. But honestly TTK is poor in documentation and you will not find everything at same place. I shall recommend to google your required information and you will find enough detail. e-g what options you mentioned in your question are not direct arguments for Combobox but it is part of Style() object and then you need to specify style object name in argument of Combobox that you can find here https://www.geeksforgeeks.org/python-add-style-to-tkinter-button/?ref=lbp. Although it is explain here for Button but applicable to other similar widgets.

Upvotes: 0

typedecker
typedecker

Reputation: 1380

For an in-depth guide to themes, the official python documentation suggests looking at the Tcl’2004 conference presentation.

Tcl’2004 conference presentation This document explains how the theme engine works

The presentation link leads to a PDF file which contains a well and deep description of the options including those mentioned in the OP.

The official python documentation for the same is here.

This and this were some other useful resources that I could find.

Upvotes: 1

Related Questions