Sujet : Tcl/Tk 9.0.1 possible ttk::spinbox bug
De : m.n.summerfield (at) *nospam* gmail.com (Mark Summerfield)
Groupes : comp.lang.tclDate : 10. Jun 2025, 10:04:48
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1028sfg$14hqg$2@dont-email.me>
User-Agent : Pan/0.154 (Izium; 517acf4)
According to:
https://www.tcl-lang.org/man/tcl9.0/TkCmd/ttk_spinbox.html#M18pathName set value
Set the spinbox string to value.
If a -format option has been configured then this format will be
applied.
So when I run the program below I expect it to show "1.23" in the spinbox
but in fact the entire number is shown.
```
#!/usr/bin/env wish9
proc main {} {
tk scaling 1.67
wm title . "Spinbox Test"
wm minsize . 240 120
wm attributes . -type dialog
ttk::spinbox .spinbox -from 1.0 -to 10.0 -format %5.2f -increment 0.1
ttk::button .quitButton -text Quit -underline 0 -command exit
bind . <Escape> { exit }
bind . <Alt-q> { exit }
pack .spinbox -side top
pack .quitButton -side top
.spinbox set 1.23456789
}
main
```