Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface Tk GUI滚动条_User Interface_Tcl_Tk - Fatal编程技术网

User interface Tk GUI滚动条

User interface Tk GUI滚动条,user-interface,tcl,tk,User Interface,Tcl,Tk,我有一个问题,滚动条似乎在左边,我已经尝试了许多组合,以便将其移动到右边 我的代码如下所示: set dataSheetFrame($k) [frame $curPath($k).frame1 -height 420 -relief groove] #pack $dataSheetFrame($k) scrollbar $dataSheetFrame($k).vscroll1 -highlightthickness 0 -orient vertical \ -width 15 s

我有一个问题,滚动条似乎在左边,我已经尝试了许多组合,以便将其移动到右边

我的代码如下所示:

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
set dataSheetFrame($k)[frame$curPath($k).frame1-高度420-泄压槽]
#打包$dataSheetFrame($k)
滚动条$dataSheetFrame($k).vscroll1-高亮厚度0-垂直定向\
-宽度15
设置视图C1($k)[canvas$dataSheetFrame($k)。canvas-高度$cHeight1-宽度$cWidth1\
-yscrollcommand“$dataSheetFrame($k).vscroll1集”\
-滚动区域“0 0$cWidth1$cHeight1”-背景黑]
网格$dataSheetFrame($k).vscroll1-在$dataSheetFrame($k)中-行0-列0\
-第1行-第1列-即时新闻
网格$viewC1($k)-在$dataSheetFrame($k)中-第0行-第1列\
-第1行-第1列-即时新闻
网格行配置$dataSheetFrame($k)0-权重1-分钟大小0
网格列配置$dataSheetFrame($k)0-权重1-分钟大小0
$viewC1($k)创建线$cellWidth 0$cellWidth$cHeight1-宽度3-填充白色
$viewC1($k)创建行[expr$CELLWITH+$dWidth]0\
[expr$cellWidth+$dWidth]$cHeight1-宽度1-填充白色
$viewC1($k)创建行[expr$cellWidth+2*$dWidth]0\
[expr$cellWidth+2*$dWidth]$cHeight1-宽度1-填充白色
对于{set i 0}{$i<[llength$cfgNames]}{incr i}{
集合名称[lindex$cfgNames$i]
$viewC1($k)创建文本[expr$cellWidth/2]\
[expr$offsety+$i*30]-锚定中心-宽度0\
-文本$name-居中对齐-填充白色
集合j1
foreach进程{慢-典型-快}{
设置y[expr$offsety+$i*30]
如果{[info exists tpfValues($name,$process)]}{
$viewC1($k)创建文本[expr$cellWidth+\
$j*$dWidth-$dWidth/2]$y\
-锚定中心-宽度0-填充白色\
-文本$tpfValues($name,$process)\
-正中
}
$viewC1($k)创建第0行[expr$y+15]$cWidth1\
[expr$y+15]-宽度3-填充白色
增量j
}
}
设置偏移量[llength$cfgNames]
对于{set i 0}{$i<[llength$tpfNames]}{incr i}{
集合名称[lindex$tpfNames$i]
$viewC1($k)创建文本[expr$cellWidth/2]\
[expr$offsety+$offsetTpf*30]-锚定中心-宽度0\
-文本$name-居中对齐-填充白色
集合j1
foreach进程{慢-典型-快}{
设置y[expr$offsety+$offsetTpf*30]
如果{[info exists tpfValues($name,$process)]}{
$viewC1($k)创建文本[expr$cellWidth+\
$j*$dWidth-$dWidth/2]$y\
-锚定中心-宽度0-填充白色\
-文本$tpfValues($name,$process)\
-正中
}
$viewC1($k)创建第0行[expr$y+15]$cWidth1\
[expr$y+15]-宽度3-填充白色
增量j
}
增量补偿
}
$dataSheetFrame($k).vscroll1 configure-命令“$viewC1($k)yview”
包装$dataSheetFrame($k)-左侧
请帮我做这个


谢谢

您将它放在第0列,因此它当然会出现在左侧。您需要将其放在比要放置画布的列更大的列号中


当您刚刚学习如何使用网格几何管理器时,如果您真的在一张图表纸上绘制GUI,它将非常有帮助。这样做可以清楚地显示每个小部件进入的列,以及它们是否需要跨越其他行或列

您应该尝试隔离您的问题,并为我们提供更精简的代码清单。这不仅对我们更好,对你们也更好。