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 |
