Changeset 3040 for trunk/gui/scripts
- Timestamp:
- Jun 13, 2012, 8:06:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/drawingentry.tcl
r3038 r3040 72 72 private method XmlGetSubst { path } 73 73 private method Withdraw {} 74 private method WatchHotspot { w item x y } 74 75 } 75 76 … … 596 597 "font" "-font" 597 598 "color" "-foreground" 599 "valuecolor" "-valueforeground" 598 600 "text" "-text" 599 601 "anchor" "-anchor" … … 604 606 array set options { 605 607 -font {Arial 8} 608 -valuefont {Arial 8 bold} 609 -valueforeground blue3 606 610 -text {} 607 611 -fill {} … … 635 639 set _cname2id($cname) $id 636 640 eval $itk_component(drawing) itemconfigure $id [array get options] 641 foreach varName [Rappture::hotspot variables $itk_component(drawing) $id] { 642 if { [info exists _name2path($varName)] } { 643 set path $_name2path($varName) 644 $_owner xml put $path.hide 1 645 } else { 646 puts stderr "unknown varName=$varName" 647 } 648 } 649 $itk_component(drawing) bind $id <Motion> \ 650 [itcl::code $this WatchHotspot %W $id %x %y] 651 } 652 653 654 itcl::body Rappture::DrawingEntry::WatchHotspot { w item x y } { 655 set x [$w canvasx $x] 656 set y [$w canvasy $y] 657 set varName [Rappture::hotspot identify $w $item $x $y] 658 puts stderr "x=$x y=$y [$w itemcget $item -text] varName=$varName" 659 $w itemconfigure $item -activevalue $varName 637 660 } 638 661 … … 914 937 itcl::body Rappture::DrawingEntry::XmlGet { path } { 915 938 set value [$_owner xml get $path] 916 if { $_parser == "" } { 917 return $value 918 } 919 return $value 939 return [string trim $value] 920 940 } 921 941 … … 925 945 return $value 926 946 } 927 return [ $_parser eval [list subst -nocommands $value]]928 } 947 return [string trim [$_parser eval [list subst -nocommands $value]]] 948 }
Note: See TracChangeset
for help on using the changeset viewer.