Tk Source Code

View Ticket
Login
Ticket UUID: 696cc431c3f49c9c97c9fb2bfc4e1944d0563c0e
Title: rfe: documentation: list styling options for ttk:: widgets
Type: RFE Version: 8.6.8
Submitter: bll Created on: 2018-04-05 16:28:34
Subsystem: 88. Themed Tk Assigned To: bll
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2018-05-03 20:34:15
Resolution: Fixed Closed By: fvogel
    Closed on: 2018-05-03 20:34:15
Description:
There is zero documentation for the styling options for the different ttk widgets.
The documentation should at a minimum list the possible styling options.
Some styling options may need some minimum explanation.
Some styling options (e.g. Treeview -rowheight) needs full documentation,
as Treeview -rowheight is a necessity.
Styling options specific to particular themes do not necessarily need to be
listed (e.g. TLabelframe -bordercolor, -lightcolor, -darkcolor (clam theme)).

I am willing to work on this, but...
My core.tcl.tk login is mucked up (I have to sign on three times to create a
ticket) and I don't have write access to the repo.
User Comments: fvogel added on 2018-05-03 20:34:15:
Merged to core-8-6-branch and trunk.

Great job Brad, many thanks!

bll added on 2018-04-28 15:21:09:
I think it is good.

fvogel added on 2018-04-28 14:10:26:

It's now ten days since branch rfe-696cc431 received its last change.

Is there more to do on this or do you think it's ready for merging?


bll added on 2018-04-09 01:29:26:
For (a), to get the compact list view I wanted, a new macro would 
need to be coded and added to the html conversion script.  

Or there can be a blank line after each option (like the 'widget command'
section for ttk::notebook).

bll added on 2018-04-08 19:54:35:
Thanks so much for the feedback.  
This is extremely helpful.

a) option name / description and blank space

I will look into alternate methods.
I am (currently) testing with 'nroff' and it looks much nicer there.

b) ttk::combobox

Users of ttk::combobox often want to modify how the listbox looks.
The expectation is that ttk::style (or widget configuration) will be 
able to do that, but it cannot.

I will move the option database information into a 
separate sub section and add some explanation.

I believe I will have some time this afternoon to clean up the noted items.
I need to test all of the Treeview options (and I need to remember
to fully document -rowheight).

I don't exactly know what TNotebook/-expand does either, though I am guessing
that it changes the padding for the selected tab.  I will test and document.

fvogel added on 2018-04-08 19:13:01:

It's rendering much better now, great! It already looks like a comprehensive set of new documentation, and that will be very useful.

Analyzing the current state of the rfe-696cc431 branch, a few comments:

- In all pages I believe the dynamic states should be in bold face (see other places in the man pages where they are mentioned)

- Some options are followed by a short description. Would it be possible to avoid the blank "line/space" between the option name and its description? Compare with description of the widget options for instance. I guess this would consist in replacing .RS/.RE by some other directive.

- ttk::combobox: I don't understand why -bordercolor is not at its alphabetical position in the list (you took care to correctly order the options otherwise), and what is the list of (also non-alphabetically ordered) "option add *TCombobox*..." ?

- ttk::entry and ttk::spinbox: -fieldbackground should be in bold face in the description of -background ; Also, alphabetical order of options not fully respected.

- ttk::labelframe: alphabetical order of options not fully respected.

- ttk::notebook: alphabetical order of options not fully respected. Also, it(s unclear to me what is the difference between -padding and -expand.

- ttk::separator and ttk::sizegrip erroneously mention ttk:frame (copy/paste error)

At some point I think it would be useful to call for a review on the Tcl Core list. This documentation could receive complements in the process.


bll added on 2018-04-07 22:58:47:
First pass is done.
Going through the code, there are still many options that
are not known.  Of course, many are specific to particular
themes.

fvogel added on 2018-04-07 15:25:21:
html, yes.

Generated by running tcltk-man2html.tcl provided with Tcl.

bll added on 2018-04-07 15:15:33:
Sigh.  I guess that is html?
And the html conversion program only knows
a limited subset of the -man macros?
Obviously, it doesn't know troff.
Rather a pain.  I shall attempt to do 
what I need within the subset.

bll added on 2018-04-07 07:49:02:
I dug through a lot of code and created this wiki page:
   http://wiki.tcl.tk/37973
The other wiki page was started by someone else, and since
it appeared they were somewhat duplicating my effort, I 
added a note.  

It seems there are styling options listed there that I 
never found.

There may well be other styling options that I never found.
I can dig through the code some more.

fvogel added on 2018-04-07 07:32:55:

Thanks for this contribution!

I believe the rendering should be improved, see attachment for current result on Win. I would have used bold for some words, and formatting directives as in other parts of the man page. It looks like you took a step toward this, but it does not appear to render as expected for me at least. Just copy formatting examples from other parts of the documentation.

Other remarks:

- Where did you find the list of available styling options? Did you dig into the code, or is it from some wiki page such as this one perhaps?

- Are these styling options always available, regardless of the theme? (I would like to avoid people coming later and telling that these options are documented but are not available for style XXX and asking us to fix this lack)


bll added on 2018-04-06 13:31:29:
Can you (and anyone else who reads this) review ttk_button.n in branch rfe-696cc431.

It is presumed that the user will read the ttk::style manual page.

This is a simple list of the styling options.  I think this is all that
is needed.

Other manual pages may include some minimal explanation or more for certain
options.

Comments, criticism, opinions, ideas?
Is there a better way to present the 'ttk::style map' options?
I could add simple examples if a little more is better.

bll added on 2018-04-06 12:55:19:
Ok, thanks, looks good.

fvogel added on 2018-04-06 00:34:07:
And I have just assigned the present ticket to you, thanks!

fvogel added on 2018-04-06 00:32:46:
Write access given to you for that purpose, does it work?

Attachments: