
package require tree

::tree::tree .t1 -width 150 -height 300 -background white -pyjamascolor {}  \
  -yscrollcommand {.sb1 set} -silent 1
scrollbar .sb1 -orient vertical -command {.t1 yview}
pack .sb1 -side right -fill y
pack .t1 -fill both -expand 1

foreach w {.t1} dirim [list $::tree::idir] fileim [list $::tree::ifile] {
    foreach z {1} {
	$w newitem [list dir$z] -image $dirim -sortcommand {lsort -decreasing}
	foreach x {1 2 3 4 5} {
	    $w newitem [list dir$z file$x] -image $fileim -tags t$x$z
	}
	$w newitem [list dir$z subdir] -image $dirim -text {Text not item}
	foreach y {1 2} {
	    $w newitem [list dir$z subdir file$y] -image $fileim -style italic
	}
    }
}

