dirlist.tcl

来自「这是一个Linux下的集成开发环境」· TCL 代码 · 共 52 行

TCL
52
字号
# This file tests the pixmap image reader#proc About {} {    return "This file performs test on the DirList widget"}proc Test {} {    set w .dirlist    tixDirList $w    pack $w    set h [$w subwidget hlist]    # If we didn't specifi -value, the DirList should display the    # current directory    Assert {[tixStrEq [$w cget -value] [tixFSPWD]]}    # After changing the directory, the selection and anchor should change as    # well    set root [$h info children ""]    ClickHListEntry $h $root single    Assert {[tixStrEq [$w cget -value] [$h info data $root]]}    Assert {[tixStrEq [$h info selection] $root]}    Assert {[tixStrEq [$h info anchor]    $root]}    case [tix platform] {	unix {	    set dir1 /etc	    set dir2 /etc	}	windows {	    set dir1 C:\\Windows	    set dir2 C:\\Backup	}	default {	    return	}    }    foreach dir [list $dir1 $dir2] {	if ![file exists $dir] {	    continue	}	$w config -value $dir	Assert {[tixStrEq [$w cget -value] $dir]}	Assert {[tixStrEq [$h info data [$h info anchor]] $dir]}    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?