Tk/Tcl缩放窗口小部件间隔问题

Tk/Tcl缩放窗口小部件间隔问题,tcl,scale,resolution,Tcl,Scale,Resolution,我正在构建一个从10到100的缩放小部件,间距(间隔)为10。 当分辨率=1时,结果为: 但当分辨率=3时,刻度从9变为99,不再是10->100, 结果如下所示: 代码是: #!/bin/sh ####################################################################### \ exec /sw/freetools/tk/8.5.6/Linux/rh5/x86_64/bin/wish8.5 "$0" ${1+"$@"} pack

我正在构建一个从10到100的缩放小部件,间距(间隔)为10。 当分辨率=1时,结果为:

但当分辨率=3时,刻度从9变为99,不再是10->100, 结果如下所示:

代码是:

#!/bin/sh
####################################################################### \
exec /sw/freetools/tk/8.5.6/Linux/rh5/x86_64/bin/wish8.5 "$0" ${1+"$@"}
package require Tk

font create FONT1 -family {DejaVu Sans Mono} -size 7 -weight normal
font create FONT2 -family {DejaVu Sans} -size -8 -weight normal -slant roman

ttk::style configure rule1.TCombobox -background lavender \
                                     -foreground black \
                                     -fieldbackground mistyrose2 \
                                     -padding 0.5
ttk::style map rule1.TCombobox       -fieldbackground [list readonly gray98]

frame .frame_F1        -background gray98 -highlightbackground black -highlightthickness 1 
frame .frame_F1.top    -background gray98 -highlightbackground red   -highlightthickness 0
frame .frame_F1.bottom -background gray98 -highlightbackground blue  -highlightthickness 0

pack .frame_F1 -padx 10 -pady 10
pack .frame_F1.top    -side top -anchor w
pack .frame_F1.bottom -side bottom -anchor w

label .frame_F1.bottom.scale_text1 -text "scale" -foreground black -background gray98 -font FONT1 -justify left
entry .frame_F1.bottom.scale_value -textvariable ::SCALE      -foreground black -width 5 -justify right -state readonly

scale .frame_F1.top.scale -orient horizontal \
                          -variable ::SCALE \
                          -length 210 \
                          -from 10 -to 100 \
                          -tickinterval 10 \
                          -resolution 1 \
                          -showvalue false \
                          -background gray98 \
                          -font FONT2 \
                          -foreground black \
                          -width 12 \
                          -highlightthickness 0 \
                          -borderwidth 2 \
                          -sliderrelief groove \
                          -sliderlength 18

pack .frame_F1.top.scale
grid .frame_F1.bottom.scale_text1  -column 0 -row 1
grid .frame_F1.bottom.scale_value  -column 1 -row 1

如何更正此错误并使其从10到100?

无法复制。除了
-resolution 3
,您是否进行了任何其他更改?使用-resolution 5可以。使用-分辨率2保持10/100。使用-resolution 4将值更改为12->96,但它的末尾有100。当使用大小不是步长整数倍的范围时,您希望发生什么?