Note: You can also retrieve the identifier of an iTool by specifying the IDENTIFIER keyword in the call to the routine that creates the tool (for example, IPLOT or IIMAGE).
Examples
Example 1
Suppose you have several iPlot tools running in your IDL session, and you want to retrieve the iTool identifier for one of them. Select the iPlot tool using the mouse, and issue the following IDL command:
idPlot = IGETCURRENT()
The idPlot variable will contain the iTool identifier for the selected tool.
Example 2
In the following example, we create a few iPlot tools, and use the retrieved iTool IDs to change their color property.
IPLOT, SIN(FINDGEN(361) * !DTOR), COLOR=[0,0,255], THICK=2
idPlot1 = IGETCURRENT()
seed = 1001LIPLOT, RANDOMU(seed, 25)
idPlot2 = IGETCURRENT()
result = DIALOG_MESSAGE('Click OK to reset the iTool colors.', $
/INFORMATION)
ISETPROPERTY, 'plot', COLOR=[0,255,0], TOOL=idPlot1
ISETPROPERTY, 'plot', COLOR=[255,0,255], TOOL=idPlot2
Note:
Syntax
Result = IGETCURRENT( [, THUMBBACKGROUND=Value] [, THUMBNAIL=Value] [, /THUMBORDER] [, THUMBSIZE=Value] [, TOOL=Value] )
Return Value
Returns the identifier of the current tool in the iTool system. If no tool exists, an empty string (' ') is returned.
Arguments
None.
Keywords
THUMBBACKGROUND
Set this keyword to the color of the thumbnail background. If set to 1, the color of the lower left pixel of the tool window is used as the background color. If set to an RGB triplet, that color is used. If a value is not specified, a default value of [255,255,255] (white) is used. This keyword is ignored if the THUMBNAIL keyword is not specified.
THUMBNAIL
Set this keyword to a named variable that will contain a thumbnail image of the current tool. The image is returned as a True Color (3xmxm) image.
THUMBORDER
Set this keyword to return the thumbnail in top-to-bottom order rather than the IDL default of bottom-to-top order. This keyword is ignored if the THUMBNAIL keyword is not specified.
THUMBSIZE
Set this keyword to the size of the thumbnail to return. A thumbnail is always returned as a square image. If a value is not supplied, a default value of 32 is used. THUMBSIZE must be greater than 3 and smaller than the smallest dimension of the tool window. This keyword is ignored if the THUMBNAIL keyword is not specified.
TOOL
Set this keyword to a named variable in which to return the object reference to the current tool object, or a null object if no tool exists.
Version History
6.0 |
Introduced |
6.1 |
Added TOOL keyword
|
7.1 |
Added THUMBNAIL, THUMBSIZE, THUMBORDER, and THUMBBACKGROUND keywords. Routine name changed from ITGETCURRENT to IGETCURRENT.
|
See Also
ISETCURRENT, IDELETE, IRESET