Example: File Viewer (6)
# Gets called on double clicks on an item in the tlist
proc ListCmd {index} {
global stlist dirtree
set tlist [$stlist subwidget tlist]
set file [$tlist entrycget $index -text]
if [file isdirectory $file] {
$dirtree chdir [file join [pwd] $file]
# Update the view in the tlist
TreeBrowse [file join [pwd] $file]
} else {
# Load the whole file ...
}
}