This [incr Tk] widget class displays the colors in the colormap from left to right in a generated rtdimage. In addition, bindings are added to the colorramp to rotate, shift, stretch and squeeze the colormap by dragging the mouse pointer with a button pressed.
-cursor Cursor for window. -height Height of colorramp (width is same as window). -shelp Help text displayed when mouse enters widget. -usexshm X shared memory option. -viewmaster "viewmaster" image. This is also updated when colorramp changes. This allows changes to be propagated, even if using a read-only visual. .
reset_colors {} Reset the colormap. update_colors {} Update the colorramp after the window has been resized or the number of colors has changed (need to delay to always get the correct size).
mark {pos} Mark the given position for later reference. mark_for_shift {pos} Mark the given position for later reference and set things up for a shift operation. (The dummy rotate op causes an internal copy between cmap and itt that initializes the shift from the current itt.). rotate_colors {pos} Rotate the colormap by the difference between the given position and the position set with mark. save_cmap {} Called after a shift or scale operation is done (button up) to save the colormap state. We just do a null rotate here, since it does what we want. This prevents the colormap from reverting to the original state before each shift or scale operation. The reason it would revert is that otherwise colors shifted off to the left or right, for example, would be lost. scale_itt {pos} Scale the current ITT based on the difference between the given position and the position set with mark. shift_colors {pos} Shift the colormap by the difference between the given position and the position set with mark.
canvas_ Canvas window containing ramp image. image_ Internal rtdimage widget for colorramp. mark_ Used to save a position for rotating the colormap.
Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory