Changeset 1588 for trunk/gui/scripts/combobox.tcl
- Timestamp:
- Oct 23, 2009, 3:37:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/combobox.tcl
r1342 r1588 41 41 public method value {args} 42 42 public method translate {value} 43 public method label {value} 44 public method current {} 43 45 public method choices {option args} 44 46 … … 53 55 0xfe, 0x7c, 0x38, 0x10}; 54 56 } 57 private variable _value2label 58 private variable _label2value 55 59 } 56 60 … … 153 157 } 154 158 return "" 159 } 160 161 # ---------------------------------------------------------------------- 162 # USAGE: label <value> 163 # 164 # Clients use this to translate a value to a label. 165 # ---------------------------------------------------------------------- 166 itcl::body Rappture::Combobox::label { myValue } { 167 foreach {val label} [choices get -both] { 168 if {$myValue == $val} { 169 return $label 170 } 171 } 172 return "" 173 } 174 175 # ---------------------------------------------------------------------- 176 # USAGE: getValue <value> 177 # 178 # Clients use this to translate a value to a label. 179 # ---------------------------------------------------------------------- 180 itcl::body Rappture::Combobox::current {} { 181 return [translate [$itk_component(entry) get]] 155 182 } 156 183
Note: See TracChangeset
for help on using the changeset viewer.