The CW_COLORSEL function creates a compound widget that displays all the colors in the current colormap in a 16 x 16 (320 x 320 pixels) grid. To select a color index, the user moves the mouse pointer over the desired color square and presses any mouse button. Alternatively, the color index can be selected by moving one of the three sliders provided around the grid.
This routine is written in the IDL language. Its source code can be found in the file cw_colorsel.pro in the lib subdirectory of the IDL distribution.
The command:
WIDGET_CONTROL, widgetID, SET_VALUE = -1
informs the widget to initialize itself and redraw. It should be called when any of the following happen:
To set the current color index, use the command:
WIDGET_CONTROL, widgetID, SET_VALUE = index
To retrieve the current color index and store it in the variable var, use the command:
WIDGET_CONTROL, widgetID, GET_VALUE = var
Result = CW_COLORSEL( Parent [, /FRAME] [, UNAME=string] [, UVALUE=value] [, XOFFSET=value] [, YOFFSET=value] )
This function returns the widget ID of the newly-created color index widget.
The widget ID of the parent widget.
If set, a frame is drawn around the widget.
Set this keyword to a string that can be used to identify the widget in your code. You can associate a name with each widget in a specific hierarchy, and then use that name to query the widget hierarchy and get the correct widget ID.
To query the widget hierarchy, use the WIDGET_INFO function with the FIND_BY_UNAME keyword. The UNAME should be unique to the widget hierarchy because the FIND_BY_UNAME keyword returns the ID of the first widget with the specified name.
The "user value" to be assigned to the widget.
The X offset position
The Y offset position
This widget generates event structures with the following definition:
Event = {COLORSEL_EVENT, ID: base, TOP: ev.top, HANDLER: 0L, VALUE:c}
The VALUE field is the color index selected.
Introduced: Pre 4.0
CW_CLR_INDEX, XLOADCT, XPALETTE