1
스크롤 막대가 왼쪽에있는 것처럼 보였습니다. 오른쪽으로 이동하기 위해 여러 조합을 시도했습니다.Tk GUI Scrollbar
내 코드는 다음과 같습니다
set dataSheetFrame($k) [frame $curPath($k).frame1 -height 420 -relief groove]
#pack $dataSheetFrame($k)
scrollbar $dataSheetFrame($k).vscroll1 -highlightthickness 0 -orient vertical \
-width 15
set viewC1($k) [canvas $dataSheetFrame($k).canvas -height $cHeight1 -width $cWidth1 \
-yscrollcommand "$dataSheetFrame($k).vscroll1 set" \
-scrollregion "0 0 $cWidth1 $cHeight1" -bg black]
grid $dataSheetFrame($k).vscroll1 -in $dataSheetFrame($k) -row 0 -column 0 \
-rowspan 1 -columnspan 1 -sticky news
grid $viewC1($k) -in $dataSheetFrame($k) -row 0 -column 1 \
-rowspan 1 -columnspan 1 -sticky news
grid rowconfigure $dataSheetFrame($k) 0 -weight 1 -minsize 0
grid columnconfigure $dataSheetFrame($k) 0 -weight 1 -minsize 0
$viewC1($k) create line $cellWidth 0 $cellWidth $cHeight1 -width 3 -fill white
$viewC1($k) create line [expr $cellWidth + $dWidth] 0 \
[expr $cellWidth + $dWidth] $cHeight1 -width 1 -fill white
$viewC1($k) create line [expr $cellWidth + 2 * $dWidth] 0 \
[expr $cellWidth + 2 * $dWidth] $cHeight1 -width 1 -fill white
for {set i 0} {$i < [llength $cfgNames]} {incr i} {
set name [lindex $cfgNames $i]
$viewC1($k) create text [expr $cellWidth/2] \
[expr $offsety + $i * 30 ] -anchor center -width 0 \
-text $name -justify center -fill white
set j 1
foreach process {Slow Typical Fast} {
set y [expr $offsety + $i * 30 ]
if {[info exists tpfValues($name,$process)]} {
$viewC1($k) create text [expr $cellWidth + \
$j * $dWidth - $dWidth/2] $y \
-anchor center -width 0 -fill white \
-text $tpfValues($name,$process) \
-justify center
}
$viewC1($k) create line 0 [expr $y + 15] $cWidth1 \
[expr $y + 15] -width 3 -fill white
incr j
}
}
set offsetTpf [llength $cfgNames]
for {set i 0} {$i < [llength $tpfNames]} {incr i} {
set name [lindex $tpfNames $i]
$viewC1($k) create text [expr $cellWidth/2] \
[expr $offsety + $offsetTpf * 30 ] -anchor center -width 0 \
-text $name -justify center -fill white
set j 1
foreach process {Slow Typical Fast} {
set y [expr $offsety + $offsetTpf * 30 ]
if {[info exists tpfValues($name,$process)]} {
$viewC1($k) create text [expr $cellWidth + \
$j * $dWidth - $dWidth/2] $y \
-anchor center -width 0 -fill white \
-text $tpfValues($name,$process) \
-justify center
}
$viewC1($k) create line 0 [expr $y + 15] $cWidth1 \
[expr $y + 15] -width 3 -fill white
incr j
}
incr offsetTpf
}
$dataSheetFrame($k).vscroll1 configure -command "$viewC1($k) yview"
pack $dataSheetFrame($k) -side left
이 저를 도와주세요 ..
감사
문제를 격리하고보다 압축 된 코드 목록을 제공해야합니다. 이것은 우리뿐만 아니라 당신을 위해서도 좋을 것입니다. – mouviciel