| Mary Lei 2005-04-26, 8:58 pm |
| I cannot get the treeview hide and show to work
properly with tagged nodes for blt 2.4z.
here is an example:
---------------------------------------------------------
#! wish
set auto_path "/ldas/lib $auto_path"
package require BLT
proc showSpecific { page } {
puts "button $::showSpecific($page)"
if { $::showSpecific($page) } {
eval $::treeview_resourcevars($page) hide -name ::API_LIST
} else {
eval $::treeview_resourcevars($page) show -name ::API_LIST
}
update idletasks
}
set page ligolw
set ::tree_resourcevars($page) [ blt::tree create tree_resourcevars_$page ]
set namelist { \
::API_LIST {list of API's to connect to } no {manager diskcache frame
metadata ligolw datacond mpi eventmon cntlmon} \
{manager diskcache frame metadata ligolw datacond mpi eventmon cntlmon} \
{{set ::API_LIST [ list manager diskcache frame metadata ligolw
datacond mpi eventmon cntlmon ]}} {} {set ::API_LIST} {GLOBAL} \
::BASEPORT {port from which LDAS API ports are based } no 10000 10000
{{set ::BASEPORT 10000}} {} {set ::BASEPORT} {GLOBAL} \
::LIGOLW_MAX_JOB_TIME {time out for job if no data arrives (msecs)} yes
100000 100000 {{set ::LIGOLW_MAX_JOB_TIME 100000}} {}
{set::LIGOLW_MAX_JOB_TIME} {ligolw} \
}
foreach { name desc mod curvalue origvalue line indices pattern tag }
$namelist {
;## remove the list braces and leading and trailing spaces
$::tree_resourcevars($page) insert root -label $name -data \
[ list desc $desc \
mod $mod \
curvalue $curvalue \
origvalue $origvalue line [ list $line ] \
indices $indices pattern $pattern ] -tags $tag
}
set chk [ checkbutton .specific -text "Show API specific resource only" \
-variable ::showSpecific($page) -onvalue 1 -offvalue 0 \
-width 20 -justify left -anchor w \
-command "showSpecific $page" ]
set ::treeview_resourcevars($page) [ blt::treeview .resourcevars$page \
-tree $::tree_resourcevars($page) -background gray -foreground
brown \
-bg PapayaWhip -font courier -relief raised -flat 1 -icons {}
-activeicons {} ]
$::treeview_resourcevars($page) sort auto 1
set i 0
;## add columns headers for data values
foreach item { desc mod curvalue origvalue } {
if { [ string match curvalue $item ] } {
$::treeview_resourcevars($page) column insert $i $item
-justify left -text $item -edit 1 -pad 10 \
-------------------------------------------------------
When I toggle the checkbutton, either all the nodes are hidden or
all are exposed instead of hiding or showing the ones with tag
GLOBAL.
Is this a bug ?
|