Changeset 2476 for trunk


Ignore:
Timestamp:
Sep 4, 2011 8:46:20 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/vtkviewer.tcl

    r2475 r2476  
    100100    private method MotionLegend { x y }
    101101    private method LeaveLegend {}
    102     private method SetLegendMark { x y }
     102    private method SetLegendTip { x y }
    103103
    104104    private variable _arcball ""
     
    18311831#
    18321832itcl::body Rappture::VtkViewer::EnterLegend { x y } {
    1833     SetLegendMark $x $y
     1833    SetLegendTip $x $y
    18341834}
    18351835
     
    18401840    Rappture::Tooltip::tooltip cancel
    18411841    set c $itk_component(view)
    1842     $c delete mark
    1843     SetLegendMark $x $y
     1842    SetLegendTip $x $y
    18441843}
    18451844
     
    18491848itcl::body Rappture::VtkViewer::LeaveLegend { } {
    18501849    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#
     1856itcl::body Rappture::VtkViewer::SetLegendTip { x y } {
    18591857    set c $itk_component(view)
    18601858    set w [winfo width $c]
     
    18661864    set imgY [expr $y - 2]
    18671865
    1868     if 0 {
    18691866    # 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)
    18771877
    18781878    # Compute the value of the point
Note: See TracChangeset for help on using the changeset viewer.