|
2026-10-03
| ||
| 10:59 | • Closed ticket [1867834f]: ttk Toolbutton has wrong default anchor plus 9 other changes artifact: f0f501c2 user: nemethi | |
| 10:50 | Fix for [1867834fff]: ttk Toolbutton has wrong default anchor. check-in: 3b8f72ca user: csaba tags: core-8-6-branch | |
| 09:59 | Fix for [1867834fff]: ttk Toolbutton has wrong default anchor. check-in: dd13e37a user: csaba tags: core-9-0-branch | |
| 09:42 | Fix for [1867834fff]: ttk Toolbutton has wrong default anchor. check-in: cc851a9f user: csaba tags: trunk, main | |
|
2026-09-30
| ||
| 14:12 | • Ticket [1867834f] ttk Toolbutton has wrong default anchor status still Open with 4 other changes artifact: 618e1159 user: serhiy.storchaka | |
| 14:03 | Fix [1867834]: ttk Toolbutton has wrong default anchor. The text of a Toolbutton is centered in all built-in themes, as for TButton and for Toolbutton in the clam and aqua themes: set -anchor center in the default, alt, classic, winnative and vista themes, and -justify center in all themes, so that multi-line text is centered too. closed check-in: 628bdbd3 user: serhiy.storchaka tags: toolbutton-center | |
|
2008-01-09
| ||
| 18:19 | • New ticket [1867834f] ttk Toolbutton has wrong default anchor. artifact: 2e6a848b user: boakley | |
| Ticket UUID: | 1867834 | |||
| Title: | ttk Toolbutton has wrong default anchor | |||
| Type: | Bug | Version: | 8.6.18, 9.0.5, 9.1.0 | |
| Submitter: | boakley | Created on: | 2008-01-09 18:19:27 | |
| Subsystem: | 88. Themed Tk | Assigned To: | jenglish | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2026-10-03 10:59:17 | |
| Resolution: | Fixed | Closed By: | nemethi | |
| Closed on: | 2026-10-03 10:59:17 | |||
| Description: |
Create two buttons like this:
package require Tk
ttk::button .a \
-text "Hello" \
-width 10 \
-style Toolbutton
ttk::button .b \
-text "World" \
-width 10
pack .a .b
On my windows XP machine the text of .a is left-
justified but the text of .b is centered.
The bug seems to be that the default anchor of the
Toolbutton style is left when it should be center.
I can fix this in my code with:
ttk::style configure Toolbutton -anchor center
I think the default for the Toolbutton should be
centered, shouldn't it?
| |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2026-10-03 10:59:17:
Serhiy, many thanks for fixing this very long-standing bug! Merged into main, core-9-0-branch, and core-8-6-branch by commits [cc851a9f], [dd13e37a], and [3b8f72ca]. serhiy.storchaka added on 2026-09-30 14:12:13: Still present in 9.1. Toolbutton is a separate style, and ttk style settings are not inherited across themes: every theme sets -anchor center for TButton, but only clam and aqua do so for Toolbutton, so in the default, alt, classic, winnative and vista themes the text falls back to the element default "w". Multi-line text is also left-justified within the button in all themes, while native Windows buttons and the classic Tk button center each line. Proposed fix in branch toolbutton-center: -anchor center for Toolbutton in the default, alt, classic, winnative and vista themes, and -justify center in all themes. Test ttk-17.1. Tested on Linux/X11 and Windows 11. | |||
