| Ticket UUID: | 3301552 | |||
| Title: | ttk::spinbox -font does not resize buttons | |||
| Type: | Bug | Version: | 8.5.9, 8.6.18, 9.0.5, 9.1b1 | |
| Submitter: | oehhar | Created on: | 2011-05-13 11:45:27 | |
| Subsystem: | 88. Themed Tk | Assigned To: | jenglish | |
| Priority: | 1 Zero | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2026-09-29 10:39:05 | |
| Resolution: | Fixed | Closed By: | nemethi | |
| Closed on: | 2026-09-29 10:39:05 | |||
| Description: |
tk8.5.9 on Windows Vista with native theme. ttk::spinbox with a custom large font. There apears space between the spinbuttons. See http://wiki.tcl.tk/22156 for an example and a screenshot This is not a bug, but the graphical presentation might be nicer. Thank you for all the work making Ttk so great ! | |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2026-09-29 10:39:05:
Serhiy, many thanks! Merged into main, core-9-0-branch, and core-8-6-branch by commits [e7c81329], [8ec01a62], and [98f2f50e]. Closing the ticket. serhiy.storchaka added on 2026-09-28 20:45:05: Proposed fix in branch vista-spinbox-arrows: if the layout places the arrows at the top and at the bottom of the same column, the spinbox extends them to fill the space between them. So in the vista theme each arrow button takes half of the field height, as in the native up-down control. Other themes group the arrows in the middle and are not affected. The layout in the vista_theme_improvements branch also places the arrows at the top and at the bottom, so this works with it too. serhiy.storchaka added on 2026-09-28 20:32:29: The wiki page with the example is now https://wiki.tcl-lang.org/22156. Still reproducible on Windows 11 with 8.6.18 and 9.1 in the vista theme: the vista layout of TSpinbox packs the arrows to the top and bottom of the field, so with a large font there is a gap between them. The other themes group the arrows in the middle; there the arrows keep their size, but -arrowsize can be used in clam and alt. A simple fix is to group the arrows in the vista layout too:
--- library/ttk/vistaTheme.tcl
+++ library/ttk/vistaTheme.tcl
@@ -114,6 +114,8 @@
}
}
- Spinbox.uparrow -side top -sticky ens
- Spinbox.downarrow -side bottom -sticky ens
+ null -side right -sticky e -children {
+ Spinbox.uparrow -side top -sticky e
+ Spinbox.downarrow -side bottom -sticky e
+ }
}
}
But the native Windows up-down control splits the full height of the edit between the two buttons, and this cannot be done with a ttk layout, it would need a change in C. kocsonya added on 2012-01-29 11:50:14: The bug exists for ttk::spinbox as well as ttk::combobox on linux as well (8.5.9). Also, without having the slightest idea about how the internal packer for themed widgets work, it seems that the arrow buttons use some fixed size, not one allocated by the packer. I got the layout for TSpinbox, then started to change / add -sticky and -expand options to the various child widgets. I tried pretty much all combinations. It turned out that one can move the buttons around but they will not change their size, no matter what. (I resorted to trial and error, because the docs on styles and layout and the ttk:: internal geometry manager are a tad, well, concise at best.) | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki