scrollbar

proc autoscroll { scrollbar first last} {
    if {$first <= 0 && $last >= 1} {
 grid remove $scrollbar
    } else {
 grid $scrollbar
    }
    $scrollbar set $first $last
}


itk_component add viewcryst_scroll {
 scrollbar $itk_interior.iscroll \
      -command [code $this component treectrlcom yview] \
      -orient vertical
     }
     
$itk_component(treectrlcom) configure \
     -yscrollcommand [list autoscroll $itk_component(viewcryst_scroll)]
 
grid $itk_component(treectrlcom) $itk_component(viewcryst_scroll) -sticky nswe
     

posted @ 2011-09-20 15:24  greencolor  阅读(125)  评论(0编辑  收藏  举报