Tk Source Code

View Ticket
Login
2025-02-03
19:50 Ticket [d632d28b] Themes specifying images for open/close indicators for treeview items no more working in tk 9 status still Open with 3 other changes artifact: f6abb1d2 user: fvogel
2024-06-23
12:31 Closed ticket [ca766aa9]: user1, user2 and user3 states for tabs in ttk notebook plus 6 other changes artifact: 3cb92d70 user: fvogel
2024-05-21
00:44 Ticket [527cb3cd] Documentation of ttk states status still Closed with 5 other changes artifact: b1581c3e user: emiliano
2024-05-20
19:09 Closed ticket [527cb3cd]. artifact: 9c4360bd user: jan.nijtmans
17:16
Fix [527cb3cd5d]: Documentation of ttk states. user1/user2 are no longer misused for other (internal) purposes check-in: 5f774964 user: jan.nijtmans tags: trunk, main
17:13
Fix [527cb3cd5d]: Documentation of ttk states. user1/user2 are no longer misused for other (internal) purposes check-in: 602822d2 user: jan.nijtmans tags: core-8-branch
2024-05-19
17:32 Ticket [527cb3cd] Documentation of ttk states status still Open with 3 other changes artifact: 9b00c37b user: jan.nijtmans
12:15 Ticket [527cb3cd]: 3 changes artifact: ab65a722 user: jan.nijtmans
12:09
Fix [527cb3cd5d]. Moves special internal flags outside the user1-user6 range check-in: 324cb88d user: jan.nijtmans tags: bug-527cb3cd5d
2024-05-17
15:16
Document user1-user6, and make them usable in scripts. See [527cb3cd5d] check-in: 6569a150 user: jan.nijtmans tags: trunk, main
2024-05-12
20:53 Ticket [527cb3cd] Documentation of ttk states status still Open with 3 other changes artifact: aeb89ce3 user: emiliano
19:15 Ticket [527cb3cd]: 3 changes artifact: ded5ad7f user: fvogel
2024-05-06
13:23 Ticket [527cb3cd]: 4 changes artifact: cfb58288 user: oehhar
12:43 New ticket [527cb3cd]. artifact: f625e056 user: emiliano

Ticket UUID: 527cb3cd5db53eff6f15eea9549088b477ef1a10
Title: Documentation of ttk states
Type: Bug Version: 8.7
Submitter: emiliano Created on: 2024-05-06 12:43:56
Subsystem: 88. Themed Tk Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2024-05-21 00:44:52
Resolution: Fixed Closed By: emiliano
    Closed on: 2024-05-21 00:44:52
Description:
Ttk documentation doesn't mention user flags "user1", "user2" and "user3". See https://www.tcl-lang.org/man/tcl8.6/TkCmd/ttk_widget.htm#M32 and https://core.tcl-lang.org/tk/file?ci=tip&name=generic/ttk/ttkState.c&ln=17-32

Also, ttk::notebook documentation doesn't mention the fact that the leftmost tab is always in "user1" state, and the rightmost tab is always in the "user2" state. See https://core.tcl-lang.org/tk/file?ci=tip&name=generic/ttk/ttkNotebook.c&ln=293-299
User Comments: emiliano added on 2024-05-21 00:44:52:
I admit I was concerned when saw the documentation commit without any code changes, but now all the work makes sense.

Just one last comment: wouldn't this change break ABI compatibility with an (hypothetical) C implemented theme on 8.X?

jan.nijtmans added on 2024-05-20 19:09:33:

Now merged to core-8-branch and trunk. Will be available in 9.0b3.

Thanks for all comments, they fully make sense!


jan.nijtmans added on 2024-05-19 12:15:54:

I think [324cb88dd784ca3e|this] does what @emiliano suggests.

(documentation of user* states already committed separately)

The use of "user1" in the MacOSX theme is IMHO legitimate. It can serve as an example for other user-implemented themes. But for any states used in more than a single theme, I fully agree.

If the internal "open"/"leaf"/"first"/"last" states need to be visible at script level, that still can be done. But then, the best thing to do is supply a new TIP.


emiliano added on 2024-05-12 20:53:31:
Not my call, but I couldn't agree more with your opinion.

I see there are some reserved states in https://core.tcl-lang.org/tk/file?ci=tip&name=generic/ttk/ttkState.c&ln=27-29 (which are not, name-wise, in sync with https://core.tcl-lang.org/tk/file?ci=tip&name=generic/ttk/ttkTheme.h&ln=56-58 as the comment above the former suggest).

So I also think this state of affairs should be modified to:

*) Remove all user* states usage from internals

*) Replace them with appropriate, private states.

*) Document the user* states that, as the name implies, are to be used only by user code.

fvogel added on 2024-05-12 19:15:16:
I've always beed disturbed by this fact. The examples you give are not the only one. For instance the Ttk default theme uses the user1 and user2 flags with the treeview.

<opinion>
IHMO, flags made available to users (e.g. "user1", whose name and documentation in the stateNames array carry this developer intent) should not be used internally by Ttk.

Based on this opinion I believe we should not document the current state of affairs but instead change the implementation so that it does not make use of userx flags anymore, and only then document userx flags as being available for user's use (you still following me?).
</opinion>

oehhar added on 2024-05-06 13:23:39:

Dear Ttk experts, please comment. Do we want to document this or is it internal. I suppose, the reason for this is, that the corner tabs just have another shape than the middle tabs. Or should the flag be called differently like "toptap", "bottomtab" ?

Take care, Harald