Changeset 22 for trunk/gui/scripts/booleanentry.tcl
- Timestamp:
- Jul 16, 2005, 2:31:32 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/booleanentry.tcl
r13 r22 14 14 inherit itk::Widget 15 15 16 constructor { xmlobjpath args} { # defined below }16 constructor {owner path args} { # defined below } 17 17 18 18 public method value {args} … … 23 23 protected method _newValue {} 24 24 25 private variable _ xmlobj "" ;# XML containing description25 private variable _owner "" ;# thing managing this control 26 26 private variable _path "" ;# path in XML to this number 27 27 } … … 37 37 # CONSTRUCTOR 38 38 # ---------------------------------------------------------------------- 39 itcl::body Rappture::BooleanEntry::constructor { xmlobjpath args} {40 if { ![Rappture::library isvalid $xmlobj]} {41 error "bad value \"$xmlobj\": should be Rappture::library"39 itcl::body Rappture::BooleanEntry::constructor {owner path args} { 40 if {[catch {$owner isa Rappture::ControlOwner} valid] != 0 || !$valid} { 41 error "bad object \"$owner\": should be Rappture::ControlOwner" 42 42 } 43 set _ xmlobj $xmlobj43 set _owner $owner 44 44 set _path $path 45 45 … … 54 54 bind $itk_component(switch) <<Value>> [itcl::code $this _newValue] 55 55 56 set color [$ xmlobjget $path.about.color]56 set color [$_owner xml get $path.about.color] 57 57 if {$color != ""} { 58 58 $itk_component(switch) configure -oncolor $color … … 60 60 61 61 # if the control has an icon, plug it in 62 set str [$ xmlobjget $path.about.icon]62 set str [$_owner xml get $path.about.icon] 63 63 if {$str != ""} { 64 64 $itk_component(switch) configure -onimage \ … … 71 71 # Assign the default value to this widget, if there is one. 72 72 # 73 set str [$ xmlobjget $path.default]73 set str [$_owner xml get $path.default] 74 74 if {"" != $str != ""} { $itk_component(switch) value $str } 75 75 } … … 118 118 # ---------------------------------------------------------------------- 119 119 itcl::body Rappture::BooleanEntry::label {} { 120 set label [$_ xmlobjget $_path.about.label]120 set label [$_owner xml get $_path.about.label] 121 121 if {"" == $label} { 122 122 set label "Boolean" … … 134 134 # ---------------------------------------------------------------------- 135 135 itcl::body Rappture::BooleanEntry::tooltip {} { 136 set str [$_ xmlobjget $_path.about.description]136 set str [$_owner xml get $_path.about.description] 137 137 138 set units [$_ xmlobjget $_path.units]139 set min [$_ xmlobjget $_path.min]140 set max [$_ xmlobjget $_path.max]138 set units [$_owner xml get $_path.units] 139 set min [$_owner xml get $_path.min] 140 set max [$_owner xml get $_path.max] 141 141 142 142 if {$units != "" || $min != "" || $max != ""} {
Note: See TracChangeset
for help on using the changeset viewer.