| Ticket UUID: | 4d0a6f32b79a6faac7399fc2efefb108722f01a | |||
| Title: | Unique behavior of some options in the message widget in 8.7/9.0 | |||
| Type: | Bug | Version: | 8.7b1+, 9.0b2+ | |
| Submitter: | serhiy.storchaka | Created on: | 2024-06-05 12:54:10 | |
| Subsystem: | 23. Option Parsing | Assigned To: | jan.nijtmans | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2024-06-21 10:54:31 | |
| Resolution: | Fixed | Closed By: | jan.nijtmans | |
| Closed on: | 2024-06-21 10:54:31 | |||
| Description: |
Options In Tk 8.6 (and older):
In Tk 9.0 and 8.7:
In all other widgets the behavior of these options was not changed. It is weird that it is not even consistent between I expect at least consistency between | |||
| User Comments: |
jan.nijtmans added on 2024-06-21 10:54:31:
> `message` still has a unique behavior Indeed, but that's due to this special behavior: if -padx is negative it's set to the ascent of the font divided by 2. If -pady is negative it's set to the ascent of the font divided by 4. This behavior is not documented, but it's implemented this way. So, if -padx/-pady would be reset to 0 for negative values, the current behavior would change, especially for big fonts. The -elementborderwidth option for the scrollbar has a similar special behavior, but this one is documented. TODO: fix the documentation serhiy.storchaka added on 2024-06-21 10:06:16:
jan.nijtmans added on 2024-06-14 22:20:49: Should be all OK now for buttons and message Closing jan.nijtmans added on 2024-06-10 20:17:57: > So, buttons and message (and ttk) do it correctly Thinking more about it, this is not true! Something what was never considered is caching the values of padX/padY/borderWidth/highlightWidth: Now that Tk uses scaling we cannot cache the integer values any more, since they need to be re-calculated when the scaling changes. And - also - padX/padY needs to be re-calculated when the value is "-1" and the message font changes. In [653813f7aeb1d3f3|this] commit, all of that should be corrected (for buttons and messages). Let's see what GITHUB thinks of that. jan.nijtmans added on 2024-06-07 07:28:33: > As for `-highlightthickness`, its behavior is not consistent across widgets. I created a [New ticket] for this, since `-highlightthickness` turns out not the only one with this inconsistancy. There are many more. Closing this ticket. Keep your reports coming, they are very much appreciated! jan.nijtmans added on 2024-06-06 13:37:49: Actually, everywhere TK_OPTION_PIXELS is used, the behavior should be to preserve the value. So, buttons and message (and ttk) do it correctly. When TK_CONFIG_PIXELS is used, that's the old config code: preserving the value is not possible. This means that 'text', 'entry', 'frame', 'listbox', 'menubuttons' and 'scale' should move to the other group as well..... But that's work for another ticket, I think. serhiy.storchaka added on 2024-06-06 12:48:50: As for jan.nijtmans added on 2024-06-05 21:47:05: Should be fixed now in core-8-branch and trunk. "message" now works the same (regarding -highlightthickness/-padx/-pady) as "button". The default for -padx/-pady is -1 for Tk 8.7 (unchanged) and "" for Tk 9.0. That doesn't mean that there is no padding, it just means that the padding has the default value (ascent/2 resp. ascent/4). serhiy.storchaka added on 2024-06-05 16:18:54: I'm not very good with
jan.nijtmans added on 2024-06-05 14:14:03: Does [35f81e52c42c08cf|this] work better? The change in "-highlightthickness" wat intentional: Tk should never modify given values, it should just return what's given. For Tk 9.0 the idea was to change the default from -1 to "". But that wasn't done correctly ... jan.nijtmans added on 2024-06-05 13:18:22: Thanks! I will have a look | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki