IGETCURRENT

Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also

The IGETCURRENT function gets the identifier of (and optionally, an object reference to) the current tool in the IDL Intelligent Tools system.

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).

This routine is written in the IDL language. Its source code can be found in the file igetcurrent.pro in the lib/itools subdirectory of the IDL distribution.

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.

Examples

The process of controlling an iTool from the IDL command line is discussed in detail in Controlling iTools from the IDL Command Line (iTool Developer's Guide).

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.

; Plot a few graphs, and get the iTool IDs
IPLOT, SIN(FINDGEN(361) * !DTOR), COLOR=[0,0,255], THICK=2
idPlot1 = IGETCURRENT()

seed = 1001L
IPLOT, RANDOMU(seed, 25)
idPlot2 = IGETCURRENT()

; Insert a dialog box to pause the flow of action
result = DIALOG_MESSAGE('Click OK to reset the iTool colors.', $
   /INFORMATION)

; Use the iTool IDs to reset the tool color property
ISETPROPERTY, 'plot', COLOR=[0,255,0], TOOL=idPlot1
ISETPROPERTY, 'plot', COLOR=[255,0,255], TOOL=idPlot2

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, Controlling iTools from the IDL Command Line (iTool Developer's Guide)