Changeset 997 for trunk/gui/scripts/sequence.tcl
- Timestamp:
- Apr 24, 2008 11:30:56 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/sequence.tcl
r894 r997 23 23 24 24 public method value {pos} 25 public method label {pos} 25 26 public method index {pos} 26 27 public method size {} … … 29 30 private variable _xmlobj "" ;# ref to lib obj with sequence data 30 31 private variable _dataobjs ;# maps index => data object 32 private variable _labels ;# maps index => labels 31 33 private variable _indices ;# list of sorted index values 32 34 private variable _hints ;# cache of hints stored in XML … … 51 53 } 52 54 55 # check for an element about.label stanza 56 set elelabel [$xmlobj get $path.$name.about.label] 57 53 58 set ctype "" 54 59 set _dataobjs($index) "" 60 set _labels($index) "" 55 61 foreach cname [$_xmlobj children $name] { 56 62 set type [$xmlobj element -as type $path.$name.$cname] … … 60 66 continue 61 67 } 68 about { 69 # ignore this 70 continue 71 } 62 72 curve { 63 73 set obj [Rappture::Curve ::#auto $xmlobj $path.$name.$cname] … … 100 110 if {$type == $ctype} { 101 111 lappend _dataobjs($index) $obj 112 set _labels($index) $elelabel 102 113 } else { 103 114 itcl::delete object $obj … … 172 183 173 184 # ---------------------------------------------------------------------- 185 # USAGE: label <pos> 186 # 187 # Returns the label for the element as position <pos> in the 188 # list of all elements. Here, <pos> runs from 0 to size-1. 189 # ---------------------------------------------------------------------- 190 itcl::body Rappture::Sequence::label {pos} { 191 set i [lindex [lindex $_indices $pos] 0] 192 return $_labels($i) 193 } 194 195 # ---------------------------------------------------------------------- 174 196 # USAGE: index <pos> 175 197 #
Note: See TracChangeset
for help on using the changeset viewer.