- Timestamp:
- Sep 4, 2011, 8:46:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkviewer.tcl
r2475 r2476 100 100 private method MotionLegend { x y } 101 101 private method LeaveLegend {} 102 private method SetLegend Mark{ x y }102 private method SetLegendTip { x y } 103 103 104 104 private variable _arcball "" … … 1831 1831 # 1832 1832 itcl::body Rappture::VtkViewer::EnterLegend { x y } { 1833 SetLegend Mark$x $y1833 SetLegendTip $x $y 1834 1834 } 1835 1835 … … 1840 1840 Rappture::Tooltip::tooltip cancel 1841 1841 set c $itk_component(view) 1842 $c delete mark 1843 SetLegendMark $x $y 1842 SetLegendTip $x $y 1844 1843 } 1845 1844 … … 1849 1848 itcl::body Rappture::VtkViewer::LeaveLegend { } { 1850 1849 Rappture::Tooltip::tooltip cancel 1851 #set c $itk_component(view) 1852 #$c delete mark 1853 } 1854 1855 # 1856 # SetLegendMark -- 1857 # 1858 itcl::body Rappture::VtkViewer::SetLegendMark { x y } { 1850 .rappturetooltip configure -icon "" 1851 } 1852 1853 # 1854 # SetLegendTip -- 1855 # 1856 itcl::body Rappture::VtkViewer::SetLegendTip { x y } { 1859 1857 set c $itk_component(view) 1860 1858 set w [winfo width $c] … … 1866 1864 set imgY [expr $y - 2] 1867 1865 1868 if 0 {1869 1866 # Make a swatch of the selected color 1870 set pixel [image get 0 $imgY] 1871 set swatch [image create photo -width 20 -height 20] 1872 $swatch puts $pixel -to 0 0 19 19 1873 } 1874 # Create a line over the spot 1875 $c create line [expr $w - 27] $y [expr $w - 2] $y -fill black \ 1876 -tags "legend mark" 1867 if { [catch { $_image(legend) get 10 $imgY } pixel] != 0 } { 1868 return 1869 } 1870 if { ![info exists _image(swatch)] } { 1871 set _image(swatch) [image create photo -width 24 -height 24] 1872 } 1873 set color [eval format "\#%02x%02x%02x" $pixel] 1874 $_image(swatch) put black -to 0 0 23 23 1875 $_image(swatch) put $color -to 1 1 22 22 1876 .rappturetooltip configure -icon $_image(swatch) 1877 1877 1878 1878 # Compute the value of the point
Note: See TracChangeset
for help on using the changeset viewer.